Converted all icon drawables to vector.
Removed Android-Iconics library.
@ -156,9 +156,6 @@ dependencies {
|
||||
transitive = true
|
||||
}
|
||||
|
||||
// Google material icons SVG.
|
||||
compile 'com.mikepenz:google-material-typeface:2.1.0.1.original@aar'
|
||||
|
||||
compile('com.github.afollestad.material-dialogs:core:0.8.5.6@aar') {
|
||||
transitive = true
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ class LibraryUpdateService : Service() {
|
||||
setContentTitle(manga.title)
|
||||
setProgress(total, current, false)
|
||||
setOngoing(true)
|
||||
addAction(R.drawable.ic_clear, getString(R.string.action_cancel), cancelIntent)
|
||||
addAction(R.drawable.ic_clear_black_24dp, getString(R.string.action_cancel), cancelIntent)
|
||||
}
|
||||
notificationManager.notify(UPDATE_NOTIFICATION_ID, n)
|
||||
}
|
||||
|
@ -4,13 +4,14 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.AppBarLayout;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.mikepenz.google_material_typeface_library.GoogleMaterial;
|
||||
import com.mikepenz.materialdrawer.Drawer;
|
||||
import com.mikepenz.materialdrawer.DrawerBuilder;
|
||||
import com.mikepenz.materialdrawer.holder.ImageHolder;
|
||||
import com.mikepenz.materialdrawer.model.DividerDrawerItem;
|
||||
import com.mikepenz.materialdrawer.model.PrimaryDrawerItem;
|
||||
|
||||
@ -35,6 +36,7 @@ public class MainActivity extends BaseActivity {
|
||||
int selectedItem;
|
||||
private Drawer drawer;
|
||||
private FragmentStack fragmentStack;
|
||||
private int prevIdentifier = -1;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedState) {
|
||||
@ -73,42 +75,50 @@ public class MainActivity extends BaseActivity {
|
||||
new PrimaryDrawerItem()
|
||||
.withName(R.string.label_library)
|
||||
.withIdentifier(R.id.nav_drawer_library)
|
||||
.withIcon(GoogleMaterial.Icon.gmd_book),
|
||||
.withIcon(ContextCompat.getDrawable(this, R.drawable.ic_book_grey_24dp)),
|
||||
new PrimaryDrawerItem()
|
||||
.withName(R.string.label_recent_updates)
|
||||
.withIdentifier(R.id.nav_drawer_recent_updates)
|
||||
.withIcon(GoogleMaterial.Icon.gmd_update),
|
||||
.withIcon(ContextCompat.getDrawable(this, R.drawable.ic_history_grey_24dp)),
|
||||
new PrimaryDrawerItem()
|
||||
.withName(R.string.label_catalogues)
|
||||
.withIdentifier(R.id.nav_drawer_catalogues)
|
||||
.withIcon(GoogleMaterial.Icon.gmd_explore),
|
||||
.withIcon(ContextCompat.getDrawable(this, R.drawable.ic_explore_grey_24dp)),
|
||||
new PrimaryDrawerItem()
|
||||
.withName(R.string.label_download_queue)
|
||||
.withIdentifier(R.id.nav_drawer_downloads)
|
||||
.withIcon(GoogleMaterial.Icon.gmd_file_download),
|
||||
.withIcon(ContextCompat.getDrawable(this, R.drawable.ic_file_download_grey_24dp)),
|
||||
new DividerDrawerItem(),
|
||||
new PrimaryDrawerItem()
|
||||
.withName(R.string.label_settings)
|
||||
.withIdentifier(R.id.nav_drawer_settings)
|
||||
.withSelectable(false)
|
||||
.withIcon(GoogleMaterial.Icon.gmd_settings)
|
||||
.withIcon(ContextCompat.getDrawable(this, R.drawable.ic_settings_grey_24dp))
|
||||
)
|
||||
.withSavedInstance(savedState)
|
||||
.withOnDrawerItemClickListener(
|
||||
(view, position, drawerItem) -> {
|
||||
if (drawerItem != null) {
|
||||
int identifier = drawerItem.getIdentifier();
|
||||
if (prevIdentifier != -1)
|
||||
setIconBackToGrey(prevIdentifier, identifier);
|
||||
prevIdentifier = identifier;
|
||||
|
||||
switch (identifier) {
|
||||
case R.id.nav_drawer_library:
|
||||
drawer.updateIcon(identifier, new ImageHolder(ContextCompat.getDrawable(this, R.drawable.ic_book_blue_24dp)));
|
||||
setFragment(LibraryFragment.newInstance());
|
||||
break;
|
||||
case R.id.nav_drawer_recent_updates:
|
||||
drawer.updateIcon(identifier, new ImageHolder(ContextCompat.getDrawable(this, R.drawable.ic_history_blue_24dp)));
|
||||
setFragment(RecentChaptersFragment.newInstance());
|
||||
break;
|
||||
case R.id.nav_drawer_catalogues:
|
||||
drawer.updateIcon(identifier, new ImageHolder(ContextCompat.getDrawable(this, R.drawable.ic_explore_blue_24dp)));
|
||||
setFragment(CatalogueFragment.newInstance());
|
||||
break;
|
||||
case R.id.nav_drawer_downloads:
|
||||
drawer.updateIcon(identifier, new ImageHolder(ContextCompat.getDrawable(this, R.drawable.ic_file_download_blue_24dp)));
|
||||
setFragment(DownloadFragment.newInstance());
|
||||
break;
|
||||
case R.id.nav_drawer_settings:
|
||||
@ -135,6 +145,27 @@ public class MainActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private void setIconBackToGrey(int prevIdentifier, int identifier) {
|
||||
// Don't set to grey when settings
|
||||
if (identifier == R.id.nav_drawer_settings)
|
||||
return;
|
||||
|
||||
switch (prevIdentifier) {
|
||||
case R.id.nav_drawer_library:
|
||||
drawer.updateIcon(prevIdentifier, new ImageHolder(ContextCompat.getDrawable(this, R.drawable.ic_book_grey_24dp)));
|
||||
break;
|
||||
case R.id.nav_drawer_recent_updates:
|
||||
drawer.updateIcon(prevIdentifier, new ImageHolder(ContextCompat.getDrawable(this, R.drawable.ic_history_grey_24dp)));
|
||||
break;
|
||||
case R.id.nav_drawer_catalogues:
|
||||
drawer.updateIcon(prevIdentifier, new ImageHolder(ContextCompat.getDrawable(this, R.drawable.ic_explore_grey_24dp)));
|
||||
break;
|
||||
case R.id.nav_drawer_downloads:
|
||||
drawer.updateIcon(prevIdentifier, new ImageHolder(ContextCompat.getDrawable(this, R.drawable.ic_file_download_grey_24dp)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
selectedItem = drawer.getCurrentSelection();
|
||||
|
@ -191,9 +191,9 @@ public class ReaderMenu {
|
||||
.subscribe(value -> {
|
||||
boolean isPortrait = activity.getResources().getConfiguration()
|
||||
.orientation == Configuration.ORIENTATION_PORTRAIT;
|
||||
int resourceId = value == 1 ? R.drawable.ic_screen_rotation : isPortrait ?
|
||||
R.drawable.ic_screen_lock_portrait :
|
||||
R.drawable.ic_screen_lock_landscape;
|
||||
int resourceId = value == 1 ? R.drawable.ic_screen_rotation_white_24dp : isPortrait ?
|
||||
R.drawable.ic_screen_lock_portrait_white_24dp :
|
||||
R.drawable.ic_screen_lock_landscape_white_24dp;
|
||||
|
||||
lockOrientation.setImageResource(resourceId);
|
||||
}));
|
||||
|
Before Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 327 B |
Before Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 648 B |
Before Width: | Height: | Size: 127 B |
Before Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 433 B |
Before Width: | Height: | Size: 254 B |
Before Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 190 B |
Before Width: | Height: | Size: 194 B |
Before Width: | Height: | Size: 532 B |
Before Width: | Height: | Size: 358 B |
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 219 B |
Before Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 142 B |
Before Width: | Height: | Size: 105 B |
Before Width: | Height: | Size: 205 B |
Before Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 277 B |
Before Width: | Height: | Size: 578 B |
Before Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 99 B |
Before Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 115 B |
Before Width: | Height: | Size: 326 B |
Before Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 237 B |
Before Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 147 B |
Before Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 149 B |
Before Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 225 B |
Before Width: | Height: | Size: 327 B |
Before Width: | Height: | Size: 179 B |
Before Width: | Height: | Size: 177 B |
Before Width: | Height: | Size: 158 B |
Before Width: | Height: | Size: 259 B |
Before Width: | Height: | Size: 187 B |
Before Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 160 B |
Before Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 203 B |
Before Width: | Height: | Size: 141 B |
Before Width: | Height: | Size: 404 B |
Before Width: | Height: | Size: 88 B |
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 139 B |
Before Width: | Height: | Size: 325 B |
Before Width: | Height: | Size: 191 B |
Before Width: | Height: | Size: 179 B |
Before Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 159 B |
Before Width: | Height: | Size: 349 B |
Before Width: | Height: | Size: 246 B |
Before Width: | Height: | Size: 131 B |
Before Width: | Height: | Size: 114 B |
Before Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 144 B |
Before Width: | Height: | Size: 165 B |
Before Width: | Height: | Size: 197 B |
Before Width: | Height: | Size: 114 B |
Before Width: | Height: | Size: 83 B |
Before Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 164 B |
Before Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 383 B |
Before Width: | Height: | Size: 150 B |
Before Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 86 B |
Before Width: | Height: | Size: 97 B |
Before Width: | Height: | Size: 89 B |
Before Width: | Height: | Size: 87 B |
Before Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 307 B |
Before Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 816 B |
Before Width: | Height: | Size: 97 B |
Before Width: | Height: | Size: 273 B |
Before Width: | Height: | Size: 213 B |