move all home references to base activity
This commit is contained in:
parent
45b40060f1
commit
d8d8ad96e4
10 changed files with 11 additions and 62 deletions
|
|
@ -103,16 +103,6 @@ public class AboutActivity extends AbsBaseActivity implements View.OnClickListen
|
||||||
thanksBinding.adrianWebsite.setOnClickListener(this);
|
thanksBinding.adrianWebsite.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
onBackPressed();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String getCurrentVersionName(@NonNull final Context context) {
|
private static String getCurrentVersionName(@NonNull final Context context) {
|
||||||
try {
|
try {
|
||||||
return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
|
return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
|
||||||
|
|
|
||||||
|
|
@ -67,16 +67,6 @@ public class LoginActivity extends AbsBaseActivity implements View.OnClickListen
|
||||||
binding.select.setOnClickListener(this);
|
binding.select.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
onBackPressed();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (v == binding.select) {
|
if (v == binding.select) {
|
||||||
|
|
|
||||||
|
|
@ -134,15 +134,6 @@ public class SearchActivity extends AbsMusicContentActivity implements SearchVie
|
||||||
return super.onCreateOptionsMenu(menu);
|
return super.onCreateOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
onBackPressed();
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void search(@NonNull String query) {
|
private void search(@NonNull String query) {
|
||||||
this.query = query;
|
this.query = query;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,14 +59,4 @@ public class SelectActivity extends AbsBaseActivity {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
overridePendingTransition(0, R.anim.fade_quick);
|
overridePendingTransition(0, R.anim.fade_quick);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
onBackPressed();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package com.dkanada.gramophone.activities;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.ColorInt;
|
import androidx.annotation.ColorInt;
|
||||||
|
|
@ -77,16 +76,6 @@ public class SettingsActivity extends AbsBaseActivity implements ColorChooserDia
|
||||||
public void onColorChooserDismissed(@NonNull ColorChooserDialog dialog) {
|
public void onColorChooserDismissed(@NonNull ColorChooserDialog dialog) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
onBackPressed();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class SettingsFragment extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
|
public static class SettingsFragment extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
@Override
|
@Override
|
||||||
public void onCreatePreferences(Bundle bundle, String s) {
|
public void onCreatePreferences(Bundle bundle, String s) {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
@ -83,6 +84,16 @@ public abstract class AbsBaseActivity extends AbsThemeActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == android.R.id.home) {
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
protected View getPermissionWindow() {
|
protected View getPermissionWindow() {
|
||||||
return getWindow().getDecorView();
|
return getWindow().getDecorView();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,9 +191,6 @@ public class AlbumDetailActivity extends AbsMusicContentActivity implements Pale
|
||||||
case R.id.action_add_to_playlist:
|
case R.id.action_add_to_playlist:
|
||||||
AddToPlaylistDialog.create(songs).show(getSupportFragmentManager(), "ADD_PLAYLIST");
|
AddToPlaylistDialog.create(songs).show(getSupportFragmentManager(), "ADD_PLAYLIST");
|
||||||
return true;
|
return true;
|
||||||
case android.R.id.home:
|
|
||||||
super.onBackPressed();
|
|
||||||
return true;
|
|
||||||
case R.id.action_go_to_artist:
|
case R.id.action_go_to_artist:
|
||||||
NavigationUtil.startArtist(this, new Artist(album), null);
|
NavigationUtil.startArtist(this, new Artist(album), null);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -221,9 +221,6 @@ public class ArtistDetailActivity extends AbsMusicContentActivity implements Pal
|
||||||
case R.id.action_download:
|
case R.id.action_download:
|
||||||
NavigationUtil.startDownload(this, songs);
|
NavigationUtil.startDownload(this, songs);
|
||||||
return true;
|
return true;
|
||||||
case android.R.id.home:
|
|
||||||
super.onBackPressed();
|
|
||||||
return true;
|
|
||||||
case R.id.action_colored_footers:
|
case R.id.action_colored_footers:
|
||||||
item.setChecked(!item.isChecked());
|
item.setChecked(!item.isChecked());
|
||||||
setUsePalette(item.isChecked());
|
setUsePalette(item.isChecked());
|
||||||
|
|
|
||||||
|
|
@ -112,9 +112,6 @@ public class GenreDetailActivity extends AbsMusicContentActivity implements CabH
|
||||||
case R.id.action_download:
|
case R.id.action_download:
|
||||||
NavigationUtil.startDownload(this, adapter.getDataSet());
|
NavigationUtil.startDownload(this, adapter.getDataSet());
|
||||||
return true;
|
return true;
|
||||||
case android.R.id.home:
|
|
||||||
onBackPressed();
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
|
|
|
||||||
|
|
@ -136,9 +136,6 @@ public class PlaylistDetailActivity extends AbsMusicContentActivity implements C
|
||||||
case R.id.action_download:
|
case R.id.action_download:
|
||||||
NavigationUtil.startDownload(this, adapter.getDataSet());
|
NavigationUtil.startDownload(this, adapter.getDataSet());
|
||||||
return true;
|
return true;
|
||||||
case android.R.id.home:
|
|
||||||
onBackPressed();
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return PlaylistMenuHelper.handleMenuClick(this, playlist, item);
|
return PlaylistMenuHelper.handleMenuClick(this, playlist, item);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue