Skip to content
This repository was archived by the owner on Jan 13, 2020. It is now read-only.

Commit 6f148a0

Browse files
committed
Merge branch 'release/v1.9.0'
2 parents 7bb7b89 + 68fd4a7 commit 6f148a0

File tree

6 files changed

+74
-67
lines changed

6 files changed

+74
-67
lines changed

app/build.gradle

+22-20
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ try {
66
}
77

88
android {
9-
compileSdkVersion 21
10-
buildToolsVersion "21.1.2"
9+
compileSdkVersion 23
10+
buildToolsVersion "23.0.1"
1111

1212
defaultConfig {
1313
applicationId "com.mikepenz.unsplash"
1414
minSdkVersion 16
15-
targetSdkVersion 21
16-
versionCode 185
17-
versionName "1.8.5"
15+
targetSdkVersion 22
16+
versionCode 190
17+
versionName "1.9.0"
1818
}
1919
buildTypes {
2020
debug {
@@ -54,32 +54,34 @@ android {
5454
}
5555

5656
dependencies {
57-
compile 'com.koushikdutta.ion:ion:2.0.5'
58-
compile 'com.android.support:support-v4:21.0.3'
59-
compile 'com.android.support:palette-v7:21.0.3'
60-
compile 'com.android.support:appcompat-v7:21.0.3'
61-
compile 'com.android.support:cardview-v7:21.0.3'
62-
compile 'com.android.support:recyclerview-v7:21.0.3'
57+
compile 'com.koushikdutta.ion:ion:2.1.6'
58+
59+
compile 'com.android.support:palette-v7:23.1.0'
60+
compile 'com.android.support:appcompat-v7:23.1.0'
61+
compile 'com.android.support:cardview-v7:23.1.0'
62+
compile 'com.android.support:recyclerview-v7:23.1.0'
6363

6464
compile 'com.squareup.retrofit:retrofit:1.9.0'
65-
compile 'com.squareup.okhttp:okhttp:2.2.0'
66-
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
67-
compile 'com.squareup.picasso:picasso:2.4.0'
68-
compile 'io.reactivex:rxandroid:0.24.0'
65+
compile 'com.squareup.okhttp:okhttp:2.5.0'
66+
compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
67+
compile 'com.squareup.picasso:picasso:2.5.2'
68+
compile 'io.reactivex:rxandroid:1.0.1'
6969

70-
compile 'com.nispok:snackbar:2.10.1'
70+
compile 'com.nispok:snackbar:2.11.0'
7171
compile 'com.gu:option:1.3'
7272

73-
compile 'com.github.lzyzsd:circleprogress:1.0.1@aar'
73+
compile 'com.github.lzyzsd:circleprogress:1.2.0@aar'
7474
compile 'com.github.xiprox.errorview:library:1.0.0'
7575

7676
compile 'com.google.android.apps.muzei:muzei-api:+'
7777

78-
compile 'com.mikepenz.iconics:library:0.7.5@aar'
79-
compile('com.mikepenz.aboutlibraries:library:4.5.8@aar') {
78+
compile('com.mikepenz:aboutlibraries:5.2.6@aar') {
8079
transitive = true
8180
}
82-
compile('com.mikepenz.materialdrawer:library:2.0.0@aar') {
81+
compile('com.mikepenz:materialdrawer:4.4.4@aar') {
8382
transitive = true
8483
}
84+
compile 'com.mikepenz:iconics-core:1.7.9@aar'
85+
compile 'com.mikepenz:google-material-typeface:1.2.0.1@aar'
86+
compile 'com.mikepenz:fontawesome-typeface:4.4.0.1@aar'
8587
}

app/src/main/java/com/mikepenz/unsplash/activities/DetailActivity.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import android.os.Environment;
1717
import android.support.annotation.NonNull;
1818
import android.support.v4.content.FileProvider;
19-
import android.support.v7.app.ActionBarActivity;
19+
import android.support.v7.app.AppCompatActivity;
2020
import android.support.v7.graphics.Palette;
2121
import android.support.v7.widget.Toolbar;
2222
import android.text.TextUtils;
@@ -38,8 +38,8 @@
3838
import com.koushikdutta.ion.ProgressCallback;
3939
import com.koushikdutta.ion.Response;
4040
import com.koushikdutta.ion.future.ResponseFuture;
41+
import com.mikepenz.fontawesome_typeface_library.FontAwesome;
4142
import com.mikepenz.iconics.IconicsDrawable;
42-
import com.mikepenz.iconics.typeface.FontAwesome;
4343
import com.mikepenz.unsplash.R;
4444
import com.mikepenz.unsplash.fragments.DirectoryChooserFragment;
4545
import com.mikepenz.unsplash.fragments.ImagesFragment;
@@ -55,7 +55,7 @@
5555
import java.io.InputStream;
5656

5757

58-
public class DetailActivity extends ActionBarActivity {
58+
public class DetailActivity extends AppCompatActivity {
5959
private static final int ACTIVITY_CROP = 13451;
6060
private static final int ACTIVITY_SHARE = 13452;
6161

app/src/main/java/com/mikepenz/unsplash/activities/MainActivity.java

+27-23
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
import android.graphics.Color;
44
import android.os.Bundle;
5-
import android.support.v7.app.ActionBarActivity;
5+
import android.support.v7.app.AppCompatActivity;
66
import android.support.v7.widget.Toolbar;
77
import android.view.Menu;
88
import android.view.MenuItem;
99
import android.view.View;
10-
import android.widget.AdapterView;
1110

12-
import com.mikepenz.aboutlibraries.Libs;
11+
import com.mikepenz.aboutlibraries.LibsBuilder;
12+
import com.mikepenz.fontawesome_typeface_library.FontAwesome;
1313
import com.mikepenz.google_material_typeface_library.GoogleMaterial;
1414
import com.mikepenz.iconics.IconicsDrawable;
15-
import com.mikepenz.iconics.typeface.FontAwesome;
1615
import com.mikepenz.materialdrawer.Drawer;
16+
import com.mikepenz.materialdrawer.DrawerBuilder;
17+
import com.mikepenz.materialdrawer.holder.StringHolder;
1718
import com.mikepenz.materialdrawer.model.PrimaryDrawerItem;
1819
import com.mikepenz.materialdrawer.model.SectionDrawerItem;
1920
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
@@ -23,7 +24,7 @@
2324
import com.mikepenz.unsplash.network.UnsplashApi;
2425

2526

26-
public class MainActivity extends ActionBarActivity {
27+
public class MainActivity extends AppCompatActivity {
2728
public enum Category {
2829
ALL(1000),
2930
FEATURED(1001),
@@ -42,7 +43,7 @@ private Category(int id) {
4243
}
4344
}
4445

45-
public Drawer.Result result;
46+
public Drawer result;
4647

4748
private OnFilterChangedListener onFilterChangedListener;
4849

@@ -59,7 +60,7 @@ protected void onCreate(Bundle savedInstanceState) {
5960
toolbar.setTitleTextColor(Color.WHITE);
6061
setSupportActionBar(toolbar);
6162

62-
result = new Drawer()
63+
result = new DrawerBuilder()
6364
.withActivity(this)
6465
.withToolbar(toolbar)
6566
.withHeader(R.layout.header)
@@ -75,38 +76,41 @@ protected void onCreate(Bundle savedInstanceState) {
7576
new PrimaryDrawerItem().withName(R.string.category_technology).withIdentifier(Category.TECHNOLOGY.id).withIcon(GoogleMaterial.Icon.gmd_local_see)
7677
)
7778
.withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
79+
7880
@Override
79-
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l, IDrawerItem drawerItem) {
81+
public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
8082
if (drawerItem != null) {
8183
if (drawerItem instanceof Nameable) {
82-
toolbar.setTitle(((Nameable) drawerItem).getNameRes());
84+
toolbar.setTitle(((Nameable) drawerItem).getName().getText(MainActivity.this));
8385
}
8486
if (onFilterChangedListener != null) {
8587
onFilterChangedListener.onFilterChanged(drawerItem.getIdentifier());
8688
}
8789
}
90+
91+
return false;
8892
}
8993
})
9094
.build();
9195

9296
//disable scrollbar :D it's ugly
93-
result.getListView().setVerticalScrollBarEnabled(false);
97+
result.getRecyclerView().setVerticalScrollBarEnabled(false);
9498
}
9599

96100
/**
97101
* @param images
98102
*/
99103
public void setCategoryCount(ImageList images) {
100104
if (result.getDrawerItems() != null && result.getDrawerItems().size() == 9 && images != null && images.getData() != null) {
101-
result.updateBadge(images.getData().size() + "", 0);
102-
result.updateBadge(UnsplashApi.countFeatured(images.getData()) + "", 1);
103-
104-
result.updateBadge(UnsplashApi.countCategory(images.getData(), Category.BUILDINGS.id) + "", 3);
105-
result.updateBadge(UnsplashApi.countCategory(images.getData(), Category.FOOD.id) + "", 4);
106-
result.updateBadge(UnsplashApi.countCategory(images.getData(), Category.NATURE.id) + "", 5);
107-
result.updateBadge(UnsplashApi.countCategory(images.getData(), Category.OBJECTS.id) + "", 6);
108-
result.updateBadge(UnsplashApi.countCategory(images.getData(), Category.PEOPLE.id) + "", 7);
109-
result.updateBadge(UnsplashApi.countCategory(images.getData(), Category.TECHNOLOGY.id) + "", 8);
105+
result.updateBadge(Category.ALL.id, new StringHolder(images.getData().size() + ""));
106+
result.updateBadge(Category.FEATURED.id, new StringHolder(UnsplashApi.countFeatured(images.getData()) + ""));
107+
108+
result.updateBadge(Category.BUILDINGS.id, new StringHolder(UnsplashApi.countCategory(images.getData(), Category.BUILDINGS.id) + ""));
109+
result.updateBadge(Category.FOOD.id, new StringHolder(UnsplashApi.countCategory(images.getData(), Category.FOOD.id) + ""));
110+
result.updateBadge(Category.NATURE.id, new StringHolder(UnsplashApi.countCategory(images.getData(), Category.NATURE.id) + ""));
111+
result.updateBadge(Category.OBJECTS.id, new StringHolder(UnsplashApi.countCategory(images.getData(), Category.OBJECTS.id) + ""));
112+
result.updateBadge(Category.PEOPLE.id, new StringHolder(UnsplashApi.countCategory(images.getData(), Category.PEOPLE.id) + ""));
113+
result.updateBadge(Category.TECHNOLOGY.id, new StringHolder(UnsplashApi.countCategory(images.getData(), Category.TECHNOLOGY.id) + ""));
110114
}
111115
}
112116

@@ -115,8 +119,8 @@ public boolean onCreateOptionsMenu(Menu menu) {
115119
// Inflate the menu; this adds items to the action bar if it is present.
116120
getMenuInflater().inflate(R.menu.menu_main, menu);
117121

118-
menu.findItem(R.id.action_open_source).setIcon(new IconicsDrawable(this, FontAwesome.Icon.faw_github).color(Color.WHITE).actionBarSize());
119-
menu.findItem(R.id.action_shuffle).setIcon(new IconicsDrawable(this, GoogleMaterial.Icon.gmd_shuffle).paddingDp(1).color(Color.WHITE).actionBarSize());
122+
menu.findItem(R.id.action_open_source).setIcon(new IconicsDrawable(this, FontAwesome.Icon.faw_github).color(Color.WHITE).actionBar());
123+
menu.findItem(R.id.action_shuffle).setIcon(new IconicsDrawable(this, GoogleMaterial.Icon.gmd_shuffle).paddingDp(1).color(Color.WHITE).actionBar());
120124

121125
return true;
122126
}
@@ -125,10 +129,10 @@ public boolean onCreateOptionsMenu(Menu menu) {
125129
public boolean onOptionsItemSelected(MenuItem item) {
126130
int id = item.getItemId();
127131
if (id == R.id.action_open_source) {
128-
new Libs.Builder()
132+
new LibsBuilder()
129133
.withFields(R.string.class.getFields())
130134
.withActivityTitle(getString(R.string.action_open_source))
131-
.withActivityTheme(R.style.MaterialDrawerTheme_ActionBar)
135+
.withActivityTheme(R.style.MaterialDrawerTheme)
132136
.withLibraries("rxJava", "rxAndroid")
133137
.start(this);
134138

app/src/main/java/com/mikepenz/unsplash/network/UnsplashApi.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import rx.Observable;
2222

2323
public class UnsplashApi {
24-
public static final String ENDPOINT = "http://wallsplash.lanora.io";
24+
public static final String ENDPOINT = "http://lanora.eu/projects/wallsplash/";
2525
private final UnsplashService mWebService;
2626

2727
public static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create(); //2015-01-18 15:48:56

app/src/main/res/layout/activity_main.xml

+15-19
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

3-
<LinearLayout
4-
xmlns:android="http://schemas.android.com/apk/res/android"
3+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:app="http://schemas.android.com/apk/res-auto"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
77
android:orientation="vertical">
88

9-
<RelativeLayout
10-
android:id="@+id/activity_main_toolbar_container"
11-
android:layout_width="wrap_content"
12-
android:layout_height="wrap_content"
9+
<android.support.v7.widget.Toolbar
10+
android:id="@+id/activity_main_toolbar"
11+
android:layout_width="match_parent"
12+
android:layout_height="?attr/actionBarSize"
1313
android:background="?attr/colorPrimary"
14-
android:paddingTop="@dimen/tool_bar_top_padding">
15-
<android.support.v7.widget.Toolbar
16-
android:id="@+id/activity_main_toolbar"
17-
android:layout_width="match_parent"
18-
android:layout_height="?attr/actionBarSize"
19-
android:background="?attr/colorPrimary"
20-
android:elevation="4dp"/>
21-
</RelativeLayout>
14+
android:elevation="4dp"
15+
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
16+
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
2217

23-
<fragment android:name="com.mikepenz.unsplash.fragments.ImagesFragment"
24-
android:id="@+id/ly_last_images_fragment"
25-
android:layout_gravity="center"
26-
android:layout_height="match_parent"
27-
android:layout_width="match_parent"/>
18+
<fragment
19+
android:id="@+id/ly_last_images_fragment"
20+
android:name="com.mikepenz.unsplash.fragments.ImagesFragment"
21+
android:layout_width="match_parent"
22+
android:layout_height="match_parent"
23+
android:layout_gravity="center" />
2824

2925
</LinearLayout>
3026

build.gradle

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.1.0'
8+
classpath 'com.android.tools.build:gradle:1.3.1'
99
}
1010
}
1111

@@ -14,5 +14,10 @@ allprojects {
1414
jcenter()
1515
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
1616
maven { url 'http://guardian.github.com/maven/repo-releases' }
17+
maven { url "https://jitpack.io" }
1718
}
1819
}
20+
21+
task wrapper(type: Wrapper) {
22+
gradleVersion = '2.8'
23+
}

0 commit comments

Comments
 (0)