From 366b3d35ae8d3a410678e90f3382e457c7d9445e Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 27 Apr 2015 18:09:40 -0700 Subject: Merge work for #259 after project structure change --- .../main/res/layout/abstract_fragment_activity.xml | 193 +++++++++++++-------- 1 file changed, 117 insertions(+), 76 deletions(-) (limited to 'app/src/main/res/layout/abstract_fragment_activity.xml') diff --git a/app/src/main/res/layout/abstract_fragment_activity.xml b/app/src/main/res/layout/abstract_fragment_activity.xml index d9c99f2f..3aa6374f 100644 --- a/app/src/main/res/layout/abstract_fragment_activity.xml +++ b/app/src/main/res/layout/abstract_fragment_activity.xml @@ -1,84 +1,125 @@ - + android:gravity="bottom" + sothree:umanoPanelHeight="?attr/actionBarSize" + sothree:umanoShadowHeight="4dp" + sothree:umanoDragView="@+id/slide_up_swipe_target"> - + - + + + + - - - - - - - - + + + + + + - - - - - - - - - - + style="@style/BasicButton" + android:orientation="horizontal"> + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + \ No newline at end of file -- cgit v1.2.3 From a72e12ae06fafe1885aa763ffa04faa84afb9523 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 28 Apr 2015 17:31:59 -0700 Subject: #259 Bunch of fixes/improvements to swipe up bar --- .../dsub/activity/SubsonicActivity.java | 28 +++++++++---- .../dsub/activity/SubsonicFragmentActivity.java | 49 ++++++++++++++++++---- .../github/daneren2005/dsub/util/ImageLoader.java | 5 ++- .../abstract_fragment_container.xml | 4 +- .../main/res/layout/abstract_fragment_activity.xml | 24 +++++++---- .../res/layout/abstract_fragment_container.xml | 6 +++ app/src/main/res/values-large/dimens.xml | 2 + app/src/main/res/values/dimens.xml | 2 + app/src/main/res/values/strings.xml | 2 + 9 files changed, 94 insertions(+), 28 deletions(-) create mode 100644 app/src/main/res/layout/abstract_fragment_container.xml (limited to 'app/src/main/res/layout/abstract_fragment_activity.xml') diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java index 17f22586..814598c5 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -128,14 +128,9 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); - View actionbar = getLayoutInflater().inflate(R.layout.actionbar_spinner, null); - actionBarSpinner = (Spinner)actionbar.findViewById(R.id.spinner); - spinnerAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item); - spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - actionBarSpinner.setOnItemSelectedListener(this); - actionBarSpinner.setAdapter(spinnerAdapter); - - getSupportActionBar().setCustomView(actionbar); + if(spinnerAdapter == null) { + createCustomActionBarView(); + } getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); @@ -151,6 +146,17 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte } } + protected void createCustomActionBarView() { + View customActionbar = getLayoutInflater().inflate(R.layout.actionbar_spinner, null); + actionBarSpinner = (Spinner)customActionbar.findViewById(R.id.spinner); + spinnerAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item); + spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + actionBarSpinner.setOnItemSelectedListener(this); + actionBarSpinner.setAdapter(spinnerAdapter); + + getSupportActionBar().setCustomView(customActionbar); + } + @Override protected void onResume() { super.onResume(); @@ -520,7 +526,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte } } - private void drawerItemSelected(int position, View view) { + protected void drawerItemSelected(int position, View view) { startFragmentActivity(drawerItemsDescriptions[position]); if(lastSelectedView != view) { @@ -711,6 +717,9 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte if(currentFragment == null || currentFragment.getTitle() == null) { return; } + if(spinnerAdapter == null) { + createCustomActionBarView(); + } if(backStack.size() > 0) { spinnerAdapter.clear(); @@ -733,6 +742,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte getSupportActionBar().setDisplayShowCustomEnabled(true); } } else if(!isTv()) { + getSupportActionBar().setTitle(currentFragment.getTitle()); getSupportActionBar().setDisplayShowCustomEnabled(false); } } diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index b534adc5..83d5bce8 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -36,6 +36,7 @@ import android.util.Log; import android.view.MenuItem; import android.view.View; import android.widget.ImageButton; +import android.widget.ImageView; import android.widget.TextView; import com.sothree.slidinguppanel.SlidingUpPanelLayout; @@ -93,7 +94,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity { private ScheduledExecutorService executorService; private View bottomBar; - private View coverArtView; + private ImageView coverArtView; private TextView trackView; private TextView artistView; private ImageButton startButton; @@ -172,18 +173,31 @@ public class SubsonicFragmentActivity extends SubsonicActivity { nowPlayingToolbar.setVisibility(View.GONE); nowPlayingFragment.setPrimaryFragment(false); setSupportActionBar(mainToolbar); + + if(getSupportActionBar().getCustomView() == null) { + createCustomActionBarView(); + } + recreateSpinner(); + if(drawerToggle != null && backStack.size() > 0) { + drawerToggle.setDrawerIndicatorEnabled(false); + } else { + drawerToggle.setDrawerIndicatorEnabled(true); + } } @Override public void onPanelExpanded(View panel) { + // Disable custom view before switching + getSupportActionBar().setDisplayShowCustomEnabled(false); + bottomBar.setVisibility(View.GONE); nowPlayingToolbar.setVisibility(View.VISIBLE); setSupportActionBar(nowPlayingToolbar); nowPlayingFragment.setPrimaryFragment(true); + drawerToggle.setDrawerIndicatorEnabled(false); getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setHomeButtonEnabled(true); - drawerToggle.setDrawerIndicatorEnabled(true); + getSupportActionBar().setHomeAsUpIndicator(coverArtView.getDrawable()); } @Override @@ -210,7 +224,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity { bottomBar = findViewById(R.id.bottom_bar); mainToolbar = (Toolbar) findViewById(R.id.main_toolbar); nowPlayingToolbar = (Toolbar) findViewById(R.id.now_playing_toolbar); - coverArtView = bottomBar.findViewById(R.id.album_art); + coverArtView = (ImageView) bottomBar.findViewById(R.id.album_art); trackView = (TextView) bottomBar.findViewById(R.id.track_name); artistView = (TextView) bottomBar.findViewById(R.id.artist_name); @@ -454,6 +468,15 @@ public class SubsonicFragmentActivity extends SubsonicActivity { } } + @Override + protected void drawerItemSelected(int position, View view) { + super.drawerItemSelected(position, view); + + if(slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) { + slideUpPanel.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); + } + } + @Override public void startFragmentActivity(String fragmentType) { // Create a transaction that does all of this @@ -539,11 +562,23 @@ public class SubsonicFragmentActivity extends SubsonicActivity { trackView.setText(song.getTitle()); artistView.setText(song.getArtist()); } else { - trackView.setText("Title"); - artistView.setText("Artist"); + trackView.setText(R.string.main_title); + artistView.setText(R.string.main_artist); } - getImageLoader().loadImage(coverArtView, song, false, false); + SilentBackgroundTask task = getImageLoader().loadImage(coverArtView, song, false, coverArtView.getHeight(), false); + if(slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) { + if(task == null) { + getSupportActionBar().setHomeAsUpIndicator(coverArtView.getDrawable()); + } else { + task.setOnCompletionListener(new Runnable() { + @Override + public void run() { + getSupportActionBar().setHomeAsUpIndicator(coverArtView.getDrawable()); + } + }); + } + } int[] attrs = new int[] {(state == PlayerState.STARTED) ? R.attr.media_button_pause : R.attr.media_button_start}; TypedArray typedArray = this.obtainStyledAttributes(attrs); startButton.setImageResource(typedArray.getResourceId(0, 0)); diff --git a/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java b/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java index 1a0e8242..65ef46fe 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java +++ b/app/src/main/java/github/daneren2005/dsub/util/ImageLoader.java @@ -192,8 +192,11 @@ public class ImageLoader { } public SilentBackgroundTask loadImage(View view, MusicDirectory.Entry entry, boolean large, boolean crossfade) { - // TODO: If we know this a artist, try to load artist info instead int size = large ? imageSizeLarge : imageSizeDefault; + return loadImage(view, entry, large, size, crossfade); + } + public SilentBackgroundTask loadImage(View view, MusicDirectory.Entry entry, boolean large, int size, boolean crossfade) { + // TODO: If we know this a artist, try to load artist info instead if(entry != null && !entry.isAlbum() && ServerInfo.checkServerVersion(context, "1.11") && !Util.isOffline(context)) { SilentBackgroundTask task = new ArtistImageTask(view.getContext(), entry, size, imageSizeLarge, large, view, crossfade); task.execute(); diff --git a/app/src/main/res/layout-large-land/abstract_fragment_container.xml b/app/src/main/res/layout-large-land/abstract_fragment_container.xml index 5e3b1561..3901710f 100644 --- a/app/src/main/res/layout-large-land/abstract_fragment_container.xml +++ b/app/src/main/res/layout-large-land/abstract_fragment_container.xml @@ -2,8 +2,8 @@ + android:layout_height="match_parent" + android:layout_marginTop="?attr/actionBarSize"> - + + android:textSize="@dimen/BottomBar.Text.Major" + android:text="@string/main.title" + android:ellipsize="marquee" + android:marqueeRepeatLimit="marquee_forever" + android:scrollHorizontally="true" + android:focusable="true" + android:focusableInTouchMode="true"> + + + + android:textSize="@dimen/BottomBar.Text.Minor" + android:text="@string/main.artist"/> diff --git a/app/src/main/res/layout/abstract_fragment_container.xml b/app/src/main/res/layout/abstract_fragment_container.xml new file mode 100644 index 00000000..f13356c4 --- /dev/null +++ b/app/src/main/res/layout/abstract_fragment_container.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/app/src/main/res/values-large/dimens.xml b/app/src/main/res/values-large/dimens.xml index b08dda86..fe8f1a6c 100644 --- a/app/src/main/res/values-large/dimens.xml +++ b/app/src/main/res/values-large/dimens.xml @@ -4,4 +4,6 @@ 54dip 96dip 210dip + 18sp + 16sp \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index be3e843d..9759e1c2 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -4,4 +4,6 @@ 46dip 78dip 120dip + 13sp + 12sp \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b897cad6..8e7ae537 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -79,6 +79,8 @@ @string/main.albums_genres Press back again to exit Completed scan of Server + Artist + Title Search Shuffle -- cgit v1.2.3 From 57e327cc1136896be328c790c2e10b4680aedefe Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 10 Jun 2015 18:28:06 -0700 Subject: Put drawer behind system bar, color ActionBar --- app/src/main/res/layout/abstract_activity.xml | 4 +++- .../main/res/layout/abstract_fragment_activity.xml | 13 ++++++----- app/src/main/res/values-v21/themes.xml | 10 +++++++++ app/src/main/res/values/themes.xml | 26 +++++----------------- 4 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 app/src/main/res/values-v21/themes.xml (limited to 'app/src/main/res/layout/abstract_fragment_activity.xml') diff --git a/app/src/main/res/layout/abstract_activity.xml b/app/src/main/res/layout/abstract_activity.xml index f012f484..56db1439 100644 --- a/app/src/main/res/layout/abstract_activity.xml +++ b/app/src/main/res/layout/abstract_activity.xml @@ -4,7 +4,9 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:fitsSystemWindows="true"> + + android:layout_width="match_parent" + android:background="?attr/colorPrimary" + android:elevation="4dp"/> @@ -30,13 +31,14 @@ + android:layout_height="wrap_content" + android:background="?attr/colorPrimary"> + android:orientation="horizontal" + android:elevation="4dp"> + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 27082530..ecba7592 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,8 +1,6 @@ - - + + @@ -115,20 +115,6 @@ false true - - - - -- cgit v1.2.3 From ec59370dd453c2438d194610dbba2b1435ba35f8 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 22 Jun 2015 18:16:31 -0700 Subject: Theme update --- .../dsub/activity/EditPlayActionActivity.java | 2 +- .../dsub/activity/SubsonicActivity.java | 18 +++- .../dsub/activity/SubsonicFragmentActivity.java | 2 +- .../daneren2005/dsub/fragments/MainFragment.java | 2 +- .../dsub/fragments/NowPlayingFragment.java | 2 +- .../dsub/fragments/SelectDirectoryFragment.java | 2 +- .../dsub/fragments/SelectPlaylistFragment.java | 2 +- .../dsub/fragments/SelectPodcastsFragment.java | 2 +- .../dsub/fragments/SelectShareFragment.java | 2 +- .../dsub/fragments/SubsonicFragment.java | 4 +- .../github/daneren2005/dsub/util/UserUtil.java | 2 +- .../java/github/daneren2005/dsub/util/Util.java | 36 +++++--- .../github/daneren2005/dsub/view/ChangeLog.java | 2 +- .../github/daneren2005/dsub/view/ErrorDialog.java | 2 +- .../main/res/layout/abstract_fragment_activity.xml | 27 +++--- app/src/main/res/layout/actionbar_spinner.xml | 21 +++-- app/src/main/res/layout/album_list_header.xml | 5 +- app/src/main/res/layout/album_list_item.xml | 6 +- app/src/main/res/layout/basic_choice_item.xml | 3 +- app/src/main/res/layout/basic_count_item.xml | 4 +- app/src/main/res/layout/basic_header.xml | 2 +- app/src/main/res/layout/basic_list_item.xml | 3 +- app/src/main/res/layout/change_email.xml | 3 +- app/src/main/res/layout/change_password.xml | 3 +- app/src/main/res/layout/chat_item.xml | 11 ++- app/src/main/res/layout/chat_item_reverse.xml | 11 ++- app/src/main/res/layout/complex_list_item.xml | 14 +-- app/src/main/res/layout/confirm_password.xml | 3 +- app/src/main/res/layout/create_bookmark.xml | 3 +- app/src/main/res/layout/create_podcast.xml | 3 +- app/src/main/res/layout/create_user.xml | 9 +- app/src/main/res/layout/download_playlist.xml | 3 +- app/src/main/res/layout/edit_play_action.xml | 15 ++- app/src/main/res/layout/equalizer_bar.xml | 55 ++++++----- app/src/main/res/layout/genre_list_item.xml | 9 +- app/src/main/res/layout/jukebox_volume.xml | 46 ---------- app/src/main/res/layout/lyrics.xml | 101 ++++++++++----------- app/src/main/res/layout/progress.xml | 30 +++--- app/src/main/res/layout/save_playlist.xml | 25 ++--- app/src/main/res/layout/search_buttons.xml | 73 --------------- app/src/main/res/layout/seekbar_preference.xml | 3 +- app/src/main/res/layout/select_album_header.xml | 15 ++- app/src/main/res/layout/select_artist_header.xml | 6 +- app/src/main/res/layout/settings_activity.xml | 33 ++++--- app/src/main/res/layout/shuffle_dialog.xml | 9 +- app/src/main/res/layout/song_list_item.xml | 29 +++--- app/src/main/res/layout/start_timer.xml | 3 +- app/src/main/res/layout/sync_dialog.xml | 3 +- app/src/main/res/layout/tab_progress.xml | 3 +- app/src/main/res/layout/update_playlist.xml | 9 +- app/src/main/res/layout/update_share.xml | 9 +- app/src/main/res/layout/user_header.xml | 6 +- app/src/main/res/layout/user_list_item.xml | 3 +- app/src/main/res/menu/select_album.xml | 2 +- app/src/main/res/menu/select_album_list.xml | 2 +- app/src/main/res/menu/select_song.xml | 2 +- app/src/main/res/menu/select_song_offline.xml | 2 +- app/src/main/res/menu/similar_artists.xml | 2 +- app/src/main/res/values-v16/themes.xml | 15 --- app/src/main/res/values/attrs.xml | 9 ++ app/src/main/res/values/colors.xml | 15 ++- app/src/main/res/values/styles.xml | 32 ------- app/src/main/res/values/themes.xml | 74 ++++++++------- 63 files changed, 397 insertions(+), 457 deletions(-) delete mode 100644 app/src/main/res/layout/jukebox_volume.xml delete mode 100644 app/src/main/res/layout/search_buttons.xml delete mode 100644 app/src/main/res/values-v16/themes.xml (limited to 'app/src/main/res/layout/abstract_fragment_activity.xml') diff --git a/app/src/main/java/github/daneren2005/dsub/activity/EditPlayActionActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/EditPlayActionActivity.java index e1f2cad3..0396f8a4 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/EditPlayActionActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/EditPlayActionActivity.java @@ -16,7 +16,7 @@ package github.daneren2005.dsub.activity; import android.app.Activity; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java index fe785ef8..f7e7251c 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -35,7 +35,8 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v4.widget.DrawerLayout; -import android.support.v7.app.ActionBarActivity; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.KeyEvent; import android.view.LayoutInflater; @@ -72,7 +73,7 @@ import github.daneren2005.dsub.util.Util; import github.daneren2005.dsub.view.UpdateView; import github.daneren2005.dsub.util.UserUtil; -public class SubsonicActivity extends ActionBarActivity implements OnItemSelectedListener { +public class SubsonicActivity extends AppCompatActivity implements OnItemSelectedListener { private static final String TAG = SubsonicActivity.class.getSimpleName(); private static ImageLoader IMAGE_LOADER; protected static String theme; @@ -239,10 +240,10 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte drawerList = (NavigationView) findViewById(R.id.left_drawer); drawerList.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { @Override - public boolean onNavigationItemSelected(MenuItem menuItem) { + public boolean onNavigationItemSelected(final MenuItem menuItem) { if(showingTabs) { // Settings are on a different selectable track - if (menuItem.getItemId() != R.id.drawer_settings) { + if (menuItem.getItemId() != R.id.drawer_settings && menuItem.getItemId() != R.id.drawer_admin) { menuItem.setChecked(true); lastSelectedPosition = menuItem.getItemId(); } @@ -275,10 +276,14 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte @Override public void run() { drawerItemSelected("Admin"); + menuItem.setChecked(true); + lastSelectedPosition = menuItem.getItemId(); } }); } else { drawerItemSelected("Admin"); + menuItem.setChecked(true); + lastSelectedPosition = menuItem.getItemId(); } return true; case R.id.drawer_downloading: @@ -322,7 +327,9 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte if(!isTv()) { drawer = (DrawerLayout) findViewById(R.id.drawer_layout); - drawerToggle = new ActionBarDrawerToggle(this, drawer, R.string.common_appname, R.string.common_appname) { + // Pass in toolbar if it exists + Toolbar toolbar = (Toolbar) findViewById(R.id.main_toolbar); + drawerToggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.common_appname, R.string.common_appname) { @Override public void onDrawerClosed(View view) { setTitle(currentFragment.getTitle()); @@ -805,6 +812,7 @@ public class SubsonicActivity extends ActionBarActivity implements OnItemSelecte Intent intent = new Intent(this, ((Object) this).getClass()); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putExtras(getIntent()); + intent.putExtra(Constants.FRAGMENT_POSITION, lastSelectedPosition); Util.startActivityWithoutTransition(this, intent); } diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index db7559b3..95ec7c15 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -613,7 +613,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity { getImageLoader().loadImage(coverArtView, song, false, height, false); } - int[] attrs = new int[] {(state == PlayerState.STARTED) ? R.attr.media_button_pause : R.attr.media_button_start}; + int[] attrs = new int[] {(state == PlayerState.STARTED) ? R.attr.actionbar_pause : R.attr.actionbar_start}; TypedArray typedArray = this.obtainStyledAttributes(attrs); startButton.setImageResource(typedArray.getResourceId(0, 0)); typedArray.recycle(); diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/MainFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/MainFragment.java index 90a91383..96e1d326 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/MainFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/MainFragment.java @@ -1,6 +1,6 @@ package github.daneren2005.dsub.fragments; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java index 851e9478..151a66ca 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java @@ -21,7 +21,7 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import android.annotation.TargetApi; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 417b1328..08a051cf 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -1,7 +1,7 @@ package github.daneren2005.dsub.fragments; import android.annotation.TargetApi; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java index 2f2cfcc1..49589971 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java @@ -1,6 +1,6 @@ package github.daneren2005.dsub.fragments; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.DialogInterface; import android.content.res.Resources; import android.os.Bundle; diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java index eebb1a8a..520d0414 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectPodcastsFragment.java @@ -14,7 +14,7 @@ */ package github.daneren2005.dsub.fragments; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.ContextMenu; diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectShareFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectShareFragment.java index 87dd55b4..3d79b7b9 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectShareFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectShareFragment.java @@ -15,7 +15,7 @@ package github.daneren2005.dsub.fragments; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.ContextMenu; diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java index cc9f8d62..a155e807 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -20,7 +20,7 @@ package github.daneren2005.dsub.fragments; import android.annotation.TargetApi; import android.app.Activity; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -34,12 +34,14 @@ import android.os.Bundle; import android.os.StatFs; import android.support.v4.app.Fragment; import android.support.v4.widget.SwipeRefreshLayout; +import android.support.v7.internal.view.ContextThemeWrapper; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.ContextMenu; import android.view.GestureDetector; +import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; diff --git a/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java b/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java index fb2de05e..d758c4c9 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java +++ b/app/src/main/java/github/daneren2005/dsub/util/UserUtil.java @@ -16,7 +16,7 @@ package github.daneren2005.dsub.util; import android.app.Activity; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.SharedPreferences; diff --git a/app/src/main/java/github/daneren2005/dsub/util/Util.java b/app/src/main/java/github/daneren2005/dsub/util/Util.java index 0160ddd0..f44bc672 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/Util.java +++ b/app/src/main/java/github/daneren2005/dsub/util/Util.java @@ -19,7 +19,7 @@ package github.daneren2005.dsub.util; import android.annotation.TargetApi; import android.app.Activity; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; @@ -251,34 +251,40 @@ public final class Util { SharedPreferences prefs = getPreferences(context); return prefs.getString(Constants.PREFERENCES_KEY_THEME, null); } - public static void setTheme(Context context, String theme) { - SharedPreferences.Editor editor = getPreferences(context).edit(); - editor.putString(Constants.PREFERENCES_KEY_THEME, theme); - editor.commit(); + public static int getThemeRes(Context context) { + return getThemeRes(context, getTheme(context)); } - - public static void applyTheme(Context context, String theme) { + public static int getThemeRes(Context context, String theme) { if(context instanceof SubsonicFragmentActivity || context instanceof SettingsActivity) { if ("dark".equals(theme)) { - context.setTheme(R.style.Theme_DSub_Dark_No_Actionbar); + return R.style.Theme_DSub_Dark_No_Actionbar; } else if ("black".equals(theme)) { - context.setTheme(R.style.Theme_DSub_Black_No_Actionbar); + return R.style.Theme_DSub_Black_No_Actionbar; } else if ("holo".equals(theme)) { - context.setTheme(R.style.Theme_DSub_Holo_No_Actionbar); + return R.style.Theme_DSub_Holo_No_Actionbar; } else { - context.setTheme(R.style.Theme_DSub_Light_No_Actionbar); + return R.style.Theme_DSub_Light_No_Actionbar; } } else { if ("dark".equals(theme)) { - context.setTheme(R.style.Theme_DSub_Dark); + return R.style.Theme_DSub_Dark; } else if ("black".equals(theme)) { - context.setTheme(R.style.Theme_DSub_Black); + return R.style.Theme_DSub_Black; } else if ("holo".equals(theme)) { - context.setTheme(R.style.Theme_DSub_Holo); + return R.style.Theme_DSub_Holo; } else { - context.setTheme(R.style.Theme_DSub_Light); + return R.style.Theme_DSub_Light; } } + } + public static void setTheme(Context context, String theme) { + SharedPreferences.Editor editor = getPreferences(context).edit(); + editor.putString(Constants.PREFERENCES_KEY_THEME, theme); + editor.commit(); + } + + public static void applyTheme(Context context, String theme) { + context.setTheme(getThemeRes(context, theme)); SharedPreferences prefs = Util.getPreferences(context); if(prefs.getBoolean(Constants.PREFERENCES_KEY_OVERRIDE_SYSTEM_LANGUAGE, false)) { diff --git a/app/src/main/java/github/daneren2005/dsub/view/ChangeLog.java b/app/src/main/java/github/daneren2005/dsub/view/ChangeLog.java index 096583c7..e3d24485 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/ChangeLog.java +++ b/app/src/main/java/github/daneren2005/dsub/view/ChangeLog.java @@ -42,7 +42,7 @@ import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.SharedPreferences; diff --git a/app/src/main/java/github/daneren2005/dsub/view/ErrorDialog.java b/app/src/main/java/github/daneren2005/dsub/view/ErrorDialog.java index 0b9d05a0..3d6eaa52 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/ErrorDialog.java +++ b/app/src/main/java/github/daneren2005/dsub/view/ErrorDialog.java @@ -19,7 +19,7 @@ package github.daneren2005.dsub.view; import android.app.Activity; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; diff --git a/app/src/main/res/layout/abstract_fragment_activity.xml b/app/src/main/res/layout/abstract_fragment_activity.xml index 74a94111..bf8d9640 100644 --- a/app/src/main/res/layout/abstract_fragment_activity.xml +++ b/app/src/main/res/layout/abstract_fragment_activity.xml @@ -1,6 +1,7 @@ + android:elevation="4dp" + android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:popupTheme="?attr/actionbarPopupStyle"/> @@ -39,7 +42,9 @@ android:layout_height="?attr/actionBarSize" android:layout_width="match_parent" android:elevation="4dp" - android:visibility="gone"/> + android:visibility="gone" + app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" + app:popupTheme="?attr/actionbarPopupStyle"/> + android:focusableInTouchMode="true" + style="?attr/actionbarTitleStyle"> + android:text="@string/main.artist" + style="?attr/actionbarSubtitleStyle"/> @@ -104,21 +105,21 @@ diff --git a/app/src/main/res/layout/actionbar_spinner.xml b/app/src/main/res/layout/actionbar_spinner.xml index 22055901..4d9f95a4 100644 --- a/app/src/main/res/layout/actionbar_spinner.xml +++ b/app/src/main/res/layout/actionbar_spinner.xml @@ -1,13 +1,14 @@ - + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:gravity="fill_horizontal" > + + diff --git a/app/src/main/res/layout/album_list_header.xml b/app/src/main/res/layout/album_list_header.xml index 58af3353..e78d0ace 100644 --- a/app/src/main/res/layout/album_list_header.xml +++ b/app/src/main/res/layout/album_list_header.xml @@ -11,7 +11,7 @@ android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" android:background="@android:color/transparent" - android:textColor="@color/cyan" + android:textColor="?attr/colorAccent" android:textStyle="bold" android:paddingLeft="6dp" android:paddingRight="6dp" @@ -24,5 +24,6 @@ android:layout_height="wrap_content" android:text="@string/main.albums_per_folder" android:layout_marginRight="6dp" - android:layout_gravity="right"/> + android:layout_gravity="right" + android:textColor="?android:textColorPrimary"/> \ No newline at end of file diff --git a/app/src/main/res/layout/album_list_item.xml b/app/src/main/res/layout/album_list_item.xml index c43e52a8..150cbd8f 100644 --- a/app/src/main/res/layout/album_list_item.xml +++ b/app/src/main/res/layout/album_list_item.xml @@ -44,14 +44,16 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:singleLine="true" android:ellipsize="marquee" - android:paddingBottom="6dip"/> + android:paddingBottom="6dip" + android:textColor="?android:textColorPrimary"/> + android:singleLine="true" + android:textColor="?android:textColorSecondary"/> diff --git a/app/src/main/res/layout/basic_choice_item.xml b/app/src/main/res/layout/basic_choice_item.xml index 00a45be4..e2dc2204 100644 --- a/app/src/main/res/layout/basic_choice_item.xml +++ b/app/src/main/res/layout/basic_choice_item.xml @@ -14,7 +14,8 @@ android:gravity="left|center_vertical" android:paddingLeft="6dip" android:paddingRight="6dip" - android:background="@android:color/transparent"/> + android:background="@android:color/transparent" + android:textColor="?android:textColorPrimary"/> + android:text="Text" + android:textColor="?android:textColorPrimary"/> \ No newline at end of file diff --git a/app/src/main/res/layout/basic_header.xml b/app/src/main/res/layout/basic_header.xml index b5ae900a..b1f94b33 100644 --- a/app/src/main/res/layout/basic_header.xml +++ b/app/src/main/res/layout/basic_header.xml @@ -5,7 +5,7 @@ android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" android:background="@android:color/transparent" - android:textColor="@color/cyan" + android:textColor="?attr/colorAccent" android:textStyle="bold" android:paddingLeft="6dp" android:paddingRight="6dp" diff --git a/app/src/main/res/layout/basic_list_item.xml b/app/src/main/res/layout/basic_list_item.xml index 88d8ca20..04fdfe06 100644 --- a/app/src/main/res/layout/basic_list_item.xml +++ b/app/src/main/res/layout/basic_list_item.xml @@ -15,7 +15,8 @@ android:paddingLeft="6dip" android:paddingRight="6dip" android:minHeight="50dip" - android:background="@android:color/transparent"/> + android:background="@android:color/transparent" + android:textColor="?android:textColorPrimary"/> + android:text="@string/admin.change_email_label" + android:textColor="?android:textColorPrimary"/> + android:text="@string/admin.change_password_label" + android:textColor="?android:textColorPrimary"/> + android:layout_height="wrap_content" + android:background="?attr/selectableItemBackground"> + android:textColor="?android:textColorPrimary"/> + android:textAppearance="?android:attr/textAppearanceSmall" + android:textColor="?android:textColorSecondary"/> + android:textAppearance="?android:attr/textAppearanceMedium" + android:textColor="?android:textColorSecondary"/> \ No newline at end of file diff --git a/app/src/main/res/layout/chat_item_reverse.xml b/app/src/main/res/layout/chat_item_reverse.xml index b8102193..31875208 100644 --- a/app/src/main/res/layout/chat_item_reverse.xml +++ b/app/src/main/res/layout/chat_item_reverse.xml @@ -2,7 +2,8 @@ + android:layout_height="wrap_content" + android:background="?attr/selectableItemBackground"> + android:textAppearance="?android:attr/textAppearanceSmall" + android:textColor="?android:textColorSecondary"/> + android:textColor="?android:textColorPrimary"/> + android:layout_gravity="right" + android:textColor="?android:textColorSecondary"/> + android:orientation="horizontal" + android:layout_width="fill_parent" + android:layout_height="?android:attr/listPreferredItemHeight" + android:background="?attr/selectableItemBackground"> + android:background="@android:color/transparent" + android:textColor="?android:textColorPrimary"/> + android:background="@android:color/transparent" + android:textColor="?android:textColorSecondary"/> + android:text="@string/admin.add_user_password" + android:textColor="?android:textColorPrimary"/> + android:text="@string/common.comment" + android:textColor="?android:textColorPrimary"/> + android:text="@string/select_podcasts.add_url" + android:textColor="?android:textColorPrimary"/> + android:layout_marginLeft="4dp" + android:textColor="?android:textColorPrimary"/> + android:layout_marginLeft="4dp" + android:textColor="?android:textColorPrimary"/> + android:layout_marginLeft="4dp" + android:textColor="?android:textColorPrimary"/> + android:padding="10dip" + android:textColor="?android:textColorPrimary"/> + android:text="@string/tasker.edit_shuffle_mode" + android:textColor="?android:textColorPrimary"/> + android:text="@string/tasker.edit_shuffle_start_year" + android:textColor="?android:textColorPrimary"/> + android:text="@string/tasker.edit_shuffle_end_year" + android:textColor="?android:textColorPrimary"/> + android:text="@string/tasker.edit_shuffle_genre" + android:textColor="?android:textColorPrimary"/>