Skip to content

Commit

Permalink
Optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
rubengees committed Oct 24, 2015
1 parent cc497e4 commit cf200da
Show file tree
Hide file tree
Showing 32 changed files with 36 additions and 28 deletions.
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
# Built application files
*.apk
*.ap_

# Files for the Dalvik VM
*.dex

# Java class files
*.class

# Sign info
*.jks

Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies {
compile('com.mikepenz:aboutlibraries:5.2.5@aar') {
transitive = true
}
compile('com.mikepenz:materialdrawer:4.3.6@aar') {
compile('com.mikepenz:materialdrawer:4.4.0@aar') {
transitive = true
}
compile 'com.mikepenz:community-material-typeface:1.2.64.1@aar'
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<service android:name=".customtabs.KeepAliveService" />

<activity
android:name=".activity.NewsImageDetailActivity"
android:name=".activity.ImageDetailActivity"
android:parentActivityName=".activity.DashboardActivity"
android:theme="@style/Theme.Transparent">
<meta-data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
*/
public class DashboardActivity extends MainActivity {

public static final String EXTRA_DRAWER_ITEM = "extra_drawer_item";
public static final String EXTRA_ADDITIONAL_INFO = "extra_additional_info";
public static final String STATE_TITLE = "dashboard_title";
private static final String EXTRA_DRAWER_ITEM = "extra_drawer_item";
private static final String EXTRA_ADDITIONAL_INFO = "extra_additional_info";
private static final String STATE_TITLE = "dashboard_title";

@Bind(R.id.toolbar)
Toolbar toolbar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.widget.ImageView;
Expand All @@ -20,22 +23,24 @@
import butterknife.ButterKnife;
import butterknife.OnClick;

import static android.app.ActivityManager.TaskDescription;

/**
* An Activity which shows a image with an animation on Lollipop and higher.
* It also has a transparent background.
*
* @author Ruben Gees
*/
public class NewsImageDetailActivity extends AppCompatActivity {
public class ImageDetailActivity extends AppCompatActivity {

public static final String EXTRA_URL = "extra_url";
private static final String EXTRA_URL = "extra_url";

@Bind(R.id.activity_news_image_detail_image)
ImageView image;

public static void navigateTo(@NonNull Activity context, @NonNull ImageView image,
@NonNull String url) {
Intent intent = new Intent(context, NewsImageDetailActivity.class);
Intent intent = new Intent(context, ImageDetailActivity.class);

intent.putExtra(EXTRA_URL, url);

Expand All @@ -54,6 +59,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_news_image_detail);

ButterKnife.bind(this);
styleRecents();

String url = getIntent().getStringExtra(EXTRA_URL);

Expand All @@ -78,6 +84,15 @@ public boolean onResourceReady(GlideDrawable resource, String model,
.into(image);
}

private void styleRecents() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
TaskDescription taskDesc = new TaskDescription(getString(R.string.app_name), bm,
ContextCompat.getColor(this, R.color.primary));
setTaskDescription(taskDesc);
}
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
import java.util.List;

/**
* Created by geesr on 17.10.2015.
* Todo: Describe Class
*
* @author Ruben Gees
*/
public abstract class PagingAdapter<T extends IdItem & Parcelable,
V extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<V> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import android.view.View;
import android.widget.ImageView;

import com.proxerme.app.activity.NewsImageDetailActivity;
import com.proxerme.app.activity.ImageDetailActivity;
import com.proxerme.app.adapter.ConferenceAdapter;
import com.proxerme.library.connection.ProxerConnection;
import com.proxerme.library.connection.ProxerException;
Expand Down Expand Up @@ -60,13 +60,13 @@ protected void configAdapter(ConferenceAdapter adapter) {
.OnConferenceInteractionListener() {
@Override
public void onConferenceClick(@NonNull View v, @NonNull Conference conference) {

//TODO
}

@Override
public void onConferenceImageClick(@NonNull View v, @NonNull Conference conference) {
if (!TextUtils.isEmpty(conference.getImageId())) {
NewsImageDetailActivity.navigateTo(getActivity(), (ImageView) v,
ImageDetailActivity.navigateTo(getActivity(), (ImageView) v,
UrlHolder.getUserImage(conference.getImageId()));
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/proxerme/app/fragment/NewsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import android.view.View;
import android.widget.ImageView;

import com.proxerme.app.activity.NewsImageDetailActivity;
import com.proxerme.app.activity.ImageDetailActivity;
import com.proxerme.app.adapter.NewsAdapter;
import com.proxerme.app.manager.NewsManager;
import com.proxerme.app.util.MaterialDrawerHelper;
Expand Down Expand Up @@ -43,7 +43,7 @@ public void onNewsClick(@NonNull View v, @NonNull News news) {

@Override
public void onNewsImageClick(@NonNull View v, @NonNull News news) {
NewsImageDetailActivity.navigateTo(getActivity(), (ImageView) v,
ImageDetailActivity.navigateTo(getActivity(), (ImageView) v,
UrlHolder.getNewsImageUrl(news.getId(), news.getImageId()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,8 @@ public boolean onItemClick(View view, int position, IDrawerItem iDrawerItem) {
new AccountHeader.OnAccountHeaderListener() {
@Override
public boolean onProfileChanged(View view, IProfile profile, boolean current) {
if (callback != null) {
return callback.onAccountClick(profile.getIdentifier());
}
return callback != null && callback.onAccountClick(profile.getIdentifier());

return false;
}
};

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-hdpi/ic_introduction_proxer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-hdpi/ic_stat_proxer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-mdpi/ic_introduction_proxer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-mdpi/ic_stat_proxer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xhdpi/ic_introduction_proxer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xhdpi/ic_stat_proxer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xxhdpi/ic_introduction_proxer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xxhdpi/ic_stat_proxer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xxxhdpi/ic_introduction_proxer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/drawable-xxxhdpi/ic_stat_proxer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_news_image_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:contentDescription="@string/image_detail_description"
android:transitionName="image"
tools:ignore="UnusedAttribute" />
</FrameLayout>
1 change: 1 addition & 0 deletions app/src/main/res/layout/item_news.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
android:layout_gravity="center_horizontal"
android:layout_margin="4dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/button_expand_description"
android:scaleType="centerCrop" />

<View
Expand Down
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@
<string name="drawer_item_messages">Messages</string>
<string name="participant_single">Participant</string>
<string name="participant_multiple">Participants</string>
<string name="image_detail_description">Detailed image</string>
<string name="button_expand_description">Expand item</string>
</resources>

0 comments on commit cf200da

Please sign in to comment.