Migrate to AppCompat

This commit is contained in:
Andrew Rabert 2019-08-24 14:28:41 -04:00
parent d62e010894
commit 66db8db769
32 changed files with 128 additions and 99 deletions

View File

@ -15,11 +15,8 @@
package net.nullsum.audinaut.activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.AlertDialog;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@ -30,6 +27,10 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Spinner;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.drawerlayout.widget.DrawerLayout;
import net.nullsum.audinaut.R;
import net.nullsum.audinaut.domain.Genre;
import net.nullsum.audinaut.service.MusicService;
@ -58,7 +59,7 @@ public class EditPlayActionActivity extends SubsonicActivity {
super.onCreate(savedInstanceState);
setTitle(R.string.tasker_start_playing_title);
setContentView(R.layout.edit_play_action);
final Activity context = this;
final AppCompatActivity context = this;
doNothing = context.getResources().getString(R.string.tasker_edit_do_nothing);
shuffleCheckbox = findViewById(R.id.edit_shuffle_checkbox);
@ -218,12 +219,12 @@ public class EditPlayActionActivity extends SubsonicActivity {
intent.putExtra(Constants.TASKER_EXTRA_BUNDLE, data);
setResult(Activity.RESULT_OK, intent);
setResult(AppCompatActivity.RESULT_OK, intent);
finish();
}
private void cancel() {
setResult(Activity.RESULT_CANCELED);
setResult(AppCompatActivity.RESULT_CANCELED);
finish();
}
}

View File

@ -19,11 +19,12 @@
package net.nullsum.audinaut.activity;
import android.app.Activity;
import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import net.nullsum.audinaut.util.Constants;
import net.nullsum.audinaut.util.Util;
@ -32,7 +33,7 @@ import net.nullsum.audinaut.util.Util;
*
* @author Sindre Mehus
*/
public class QueryReceiverActivity extends Activity {
public class QueryReceiverActivity extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {

View File

@ -19,12 +19,13 @@
package net.nullsum.audinaut.activity;
import android.app.Activity;
import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import android.provider.MediaStore;
import androidx.appcompat.app.AppCompatActivity;
import net.nullsum.audinaut.util.Constants;
import net.nullsum.audinaut.util.Util;
@ -35,7 +36,7 @@ import net.nullsum.audinaut.util.Util;
*
* @author Sindre Mehus
*/
public class VoiceQueryReceiverActivity extends Activity {
public class VoiceQueryReceiverActivity extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {

View File

@ -19,7 +19,6 @@
package net.nullsum.audinaut.fragments;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
@ -33,6 +32,8 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import androidx.appcompat.app.AppCompatActivity;
import net.nullsum.audinaut.R;
import net.nullsum.audinaut.util.Constants;
@ -215,7 +216,7 @@ public abstract class PreferenceCompatFragment extends SubsonicFragment {
private PreferenceManager createPreferenceManager() {
try {
Constructor<PreferenceManager> c = PreferenceManager.class.getDeclaredConstructor(Activity.class, int.class);
Constructor<PreferenceManager> c = PreferenceManager.class.getDeclaredConstructor(AppCompatActivity.class, int.class);
c.setAccessible(true);
return c.newInstance(this.getActivity(), FIRST_REQUEST_CODE);
} catch (Exception e) {

View File

@ -1,8 +1,6 @@
package net.nullsum.audinaut.fragments;
import android.os.Bundle;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
@ -10,6 +8,10 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import androidx.core.view.MenuItemCompat;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import net.nullsum.audinaut.R;
import net.nullsum.audinaut.adapter.ArtistAdapter;
import net.nullsum.audinaut.adapter.EntryGridAdapter;
@ -203,7 +205,7 @@ public class SearchFragment extends SubsonicFragment implements SectionAdapter.O
task.execute();
if (searchItem != null) {
searchItem.collapseActionView();
MenuItemCompat.collapseActionView(searchItem);
}
}

View File

@ -18,7 +18,6 @@
*/
package net.nullsum.audinaut.fragments;
import android.app.Activity;
import android.app.SearchManager;
import android.app.SearchableInfo;
import android.content.Context;
@ -26,13 +25,6 @@ import android.content.SharedPreferences;
import android.media.MediaMetadataRetriever;
import android.os.Bundle;
import android.os.StatFs;
import androidx.fragment.app.Fragment;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.SearchView;
import android.util.Log;
import android.view.GestureDetector;
import android.view.Menu;
@ -46,6 +38,16 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SearchView;
import androidx.core.view.MenuItemCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import net.nullsum.audinaut.R;
import net.nullsum.audinaut.activity.SubsonicActivity;
import net.nullsum.audinaut.adapter.SectionAdapter;
@ -151,7 +153,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
void onFinishSetupOptionsMenu(final Menu menu) {
searchItem = menu.findItem(R.id.menu_global_search);
if (searchItem != null) {
searchView = (SearchView) searchItem.getActionView();
searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
SearchManager searchManager = (SearchManager) context.getSystemService(Context.SEARCH_SERVICE);
SearchableInfo searchableInfo = searchManager.getSearchableInfo(context.getComponentName());
if (searchableInfo == null) {
@ -1444,7 +1446,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
boolean playNowOverride = false;
List<Entry> songs = new ArrayList<>();
public RecursiveLoader(Activity context) {
public RecursiveLoader(AppCompatActivity context) {
super(context);
musicService = MusicServiceFactory.getMusicService(context);
}

View File

@ -18,12 +18,13 @@
*/
package net.nullsum.audinaut.util;
import android.app.Activity;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import androidx.appcompat.app.AppCompatActivity;
import net.nullsum.audinaut.R;
import net.nullsum.audinaut.view.ErrorDialog;
@ -79,8 +80,8 @@ public abstract class BackgroundTask<T> implements ProgressListener {
}
}
private Activity getActivity() {
return (context instanceof Activity) ? ((Activity) context) : null;
private AppCompatActivity getActivity() {
return (context instanceof AppCompatActivity) ? ((AppCompatActivity) context) : null;
}
Handler getHandler() {
@ -95,7 +96,7 @@ public abstract class BackgroundTask<T> implements ProgressListener {
protected void error(Throwable error) {
Log.w(TAG, "Got exception: " + error, error);
Activity activity = getActivity();
AppCompatActivity activity = getActivity();
if (activity != null) {
new ErrorDialog(activity, getErrorMessage(error), true);
}

View File

@ -1,8 +1,9 @@
package net.nullsum.audinaut.util;
import android.app.Activity;
import android.app.ProgressDialog;
import androidx.appcompat.app.AppCompatActivity;
import net.nullsum.audinaut.activity.SubsonicActivity;
/**
@ -11,17 +12,17 @@ import net.nullsum.audinaut.activity.SubsonicActivity;
*/
public abstract class LoadingTask<T> extends BackgroundTask<T> {
private final Activity tabActivity;
private final AppCompatActivity tabActivity;
private final boolean cancellable;
private ProgressDialog loading;
public LoadingTask(Activity activity) {
public LoadingTask(AppCompatActivity activity) {
super(activity);
tabActivity = activity;
this.cancellable = true;
}
public LoadingTask(Activity activity, final boolean cancellable) {
public LoadingTask(AppCompatActivity activity, final boolean cancellable) {
super(activity);
tabActivity = activity;
this.cancellable = cancellable;

View File

@ -17,7 +17,6 @@
*/
package net.nullsum.audinaut.util;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.ComponentName;
@ -36,9 +35,6 @@ import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Environment;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AlertDialog;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
@ -49,6 +45,11 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import net.nullsum.audinaut.R;
import net.nullsum.audinaut.adapter.DetailsAdapter;
import net.nullsum.audinaut.domain.MusicDirectory;
@ -945,7 +946,7 @@ public final class Util {
}
}
public static void startActivityWithoutTransition(Activity currentActivity, Intent intent) {
public static void startActivityWithoutTransition(AppCompatActivity currentActivity, Intent intent) {
currentActivity.startActivity(intent);
}

View File

@ -18,9 +18,10 @@
*/
package net.nullsum.audinaut.view;
import android.app.Activity;
import android.content.Intent;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import net.nullsum.audinaut.R;
import net.nullsum.audinaut.activity.SubsonicFragmentActivity;
@ -31,11 +32,11 @@ import net.nullsum.audinaut.util.Util;
*/
public class ErrorDialog {
public ErrorDialog(Activity activity, int messageId) {
public ErrorDialog(AppCompatActivity activity, int messageId) {
this(activity, activity.getResources().getString(messageId), false);
}
public ErrorDialog(final Activity activity, String message, final boolean finishActivityOnClose) {
public ErrorDialog(final AppCompatActivity activity, String message, final boolean finishActivityOnClose) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setIcon(android.R.drawable.ic_dialog_alert);
@ -60,7 +61,7 @@ public class ErrorDialog {
}
}
private void restart(Activity activity) {
private void restart(AppCompatActivity activity) {
Intent intent = new Intent(activity, SubsonicFragmentActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Util.startActivityWithoutTransition(activity, intent);

View File

@ -106,31 +106,31 @@
android:id="@+id/download_rewind"
style="@style/PlaybackControl.BottomBar"
android:padding="2dp"
android:src="?attr/actionbar_rewind"
app:srcCompat="?attr/actionbar_rewind"
android:visibility="gone" />
<ImageButton
android:id="@+id/download_previous"
style="@style/PlaybackControl.BottomBar"
android:padding="2dp"
android:src="?attr/actionbar_backward" />
app:srcCompat="?attr/actionbar_backward" />
<ImageButton
android:id="@+id/download_start"
style="@style/PlaybackControl.BottomBar"
android:src="?attr/actionbar_start" />
app:srcCompat="?attr/actionbar_start" />
<ImageButton
android:id="@+id/download_next"
style="@style/PlaybackControl.BottomBar"
android:padding="2dp"
android:src="?attr/actionbar_forward" />
app:srcCompat="?attr/actionbar_forward" />
<ImageButton
android:id="@+id/download_fastforward"
style="@style/PlaybackControl.BottomBar"
android:padding="2dp"
android:src="?attr/actionbar_fastforward"
app:srcCompat="?attr/actionbar_fastforward"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<net.nullsum.audinaut.view.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="2dp">
@ -70,7 +71,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:src="?attr/download_none" />
app:srcCompat="?attr/download_none" />
</LinearLayout>
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@id/drag_handle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@ -52,5 +53,5 @@
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="right|center_vertical"
android:src="?attr/download_none" />
app:srcCompat="?attr/download_none" />
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/widget_root"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@ -15,7 +16,7 @@
android:layout_gravity="center_vertical"
android:clickable="true"
android:focusable="true"
android:src="@drawable/appwidget_art_default" />
app:srcCompat="@drawable/appwidget_art_default" />
<LinearLayout
android:layout_width="match_parent"
@ -87,7 +88,7 @@
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:src="@drawable/media_backward_dark" />
app:srcCompat="@drawable/media_backward_dark" />
<ImageButton
android:id="@+id/control_play"
@ -95,7 +96,7 @@
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:src="@drawable/media_start_dark" />
app:srcCompat="@drawable/media_start_dark" />
<ImageButton
android:id="@+id/control_next"
@ -103,7 +104,7 @@
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:src="@drawable/media_forward_dark" />
app:srcCompat="@drawable/media_forward_dark" />
</LinearLayout>
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/widget_root"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
@ -15,7 +16,7 @@
android:layout_gravity="center_vertical"
android:clickable="true"
android:focusable="true"
android:src="@drawable/appwidget_art_default" />
app:srcCompat="@drawable/appwidget_art_default" />
<LinearLayout
android:layout_width="match_parent"
@ -113,7 +114,7 @@
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/media_backward_dark" />
app:srcCompat="@drawable/media_backward_dark" />
<ImageButton
android:id="@+id/control_play"
@ -121,7 +122,7 @@
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/media_start_dark" />
app:srcCompat="@drawable/media_start_dark" />
<ImageButton
android:id="@+id/control_next"
@ -129,7 +130,7 @@
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/media_forward_dark" />
app:srcCompat="@drawable/media_forward_dark" />
</LinearLayout>
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/widget_root"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@ -17,7 +18,7 @@
android:paddingBottom="6dip"
android:paddingTop="6dip"
android:scaleType="fitCenter"
android:src="@drawable/appwidget_art_default" />
app:srcCompat="@drawable/appwidget_art_default" />
<LinearLayout
android:layout_width="match_parent"
@ -95,7 +96,7 @@
android:layout_width="0dip"
android:layout_height="56dip"
android:layout_weight="1"
android:src="@drawable/media_backward_dark" />
app:srcCompat="@drawable/media_backward_dark" />
<ImageButton
android:id="@+id/control_play"
@ -103,7 +104,7 @@
android:layout_width="0dip"
android:layout_height="56dip"
android:layout_weight="1"
android:src="@drawable/media_start_dark" />
app:srcCompat="@drawable/media_start_dark" />
<ImageButton
android:id="@+id/control_next"
@ -111,7 +112,7 @@
android:layout_width="0dip"
android:layout_height="56dip"
android:layout_weight="1"
android:src="@drawable/media_forward_dark" />
app:srcCompat="@drawable/media_forward_dark" />
</LinearLayout>
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/widget_root"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@ -18,7 +19,7 @@
android:paddingBottom="6dip"
android:paddingTop="6dip"
android:scaleType="fitCenter"
android:src="@drawable/appwidget_art_default" />
app:srcCompat="@drawable/appwidget_art_default" />
<LinearLayout
android:layout_width="match_parent"
@ -97,7 +98,7 @@
android:layout_width="0dip"
android:layout_height="56dip"
android:layout_weight="1"
android:src="@drawable/media_backward_dark" />
app:srcCompat="@drawable/media_backward_dark" />
<ImageButton
android:id="@+id/control_play"
@ -105,7 +106,7 @@
android:layout_width="0dip"
android:layout_height="56dip"
android:layout_weight="1"
android:src="@drawable/media_start_dark" />
app:srcCompat="@drawable/media_start_dark" />
<ImageButton
android:id="@+id/control_next"
@ -113,7 +114,7 @@
android:layout_width="0dip"
android:layout_height="56dip"
android:layout_weight="1"
android:src="@drawable/media_forward_dark" />
app:srcCompat="@drawable/media_forward_dark" />
</LinearLayout>
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
@ -30,5 +31,5 @@
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="right|center_vertical"
android:src="?attr/download_none" />
app:srcCompat="?attr/download_none" />
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<net.nullsum.audinaut.view.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="2dp">
@ -39,7 +40,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:src="?attr/download_none" />
app:srcCompat="?attr/download_none" />
</LinearLayout>
</LinearLayout>
</net.nullsum.audinaut.view.CardView>

View File

@ -8,7 +8,7 @@
<TextView
android:id="@+id/item_name"
android:layout_width="0dip"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_height="?attr/listPreferredItemHeight"
android:layout_weight="1"
android:background="@android:color/transparent"
android:gravity="left|center_vertical"

View File

@ -30,7 +30,7 @@
android:gravity="right|center_vertical"
android:paddingRight="10dp"
android:text="99"
android:textAppearance="?android:attr/textAppearanceSmallPopupMenu"
android:textAppearance="?attr/textAppearanceSmallPopupMenu"
android:textColor="?android:textColorPrimary"
android:textSize="11sp"
android:visibility="gone" />

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
@ -24,5 +25,5 @@
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="right|center_vertical"
android:src="?attr/download_none" />
app:srcCompat="?attr/download_none" />
</LinearLayout>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
@ -10,7 +11,7 @@
style="@style/PlaybackControl"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:src="?attr/media_button_repeat_off" />
app:srcCompat="?attr/media_button_repeat_off" />
<net.nullsum.audinaut.view.AutoRepeatButton
android:id="@+id/download_previous"
@ -31,21 +32,21 @@
android:id="@+id/download_pause"
style="@style/PlaybackControl.Larger"
android:layout_centerInParent="true"
android:src="?attr/media_button_pause"
app:srcCompat="?attr/media_button_pause"
android:visibility="invisible" />
<ImageButton
android:id="@+id/download_stop"
style="@style/PlaybackControl.Larger"
android:layout_centerInParent="true"
android:src="?attr/media_button_stop"
app:srcCompat="?attr/media_button_stop"
android:visibility="invisible" />
<ImageButton
android:id="@+id/download_start"
style="@style/PlaybackControl.Larger"
android:layout_centerInParent="true"
android:src="?attr/media_button_start" />
app:srcCompat="?attr/media_button_start" />
<net.nullsum.audinaut.view.AutoRepeatButton
android:id="@+id/download_fastforward"
@ -67,5 +68,5 @@
style="@style/PlaybackControl"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="?attr/toggle_list" />
app:srcCompat="?attr/toggle_list" />
</RelativeLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="178dp"
android:background="?attr/drawerHeaderBackground"
@ -46,6 +47,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingRight="20dp"
android:src="@drawable/main_select_server_dark" />
app:srcCompat="@drawable/main_select_server_dark" />
</LinearLayout>
</RelativeLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
@ -28,5 +29,5 @@
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:src="?attr/select_server" />
app:srcCompat="?attr/select_server" />
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="match_parent">
@ -22,5 +23,5 @@
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginRight="@dimen/FastScroller.RightMargin"
android:src="@drawable/fast_scroller_handle" />
app:srcCompat="@drawable/fast_scroller_handle" />
</merge>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
@ -49,17 +50,17 @@
<ImageButton
android:id="@+id/control_previous"
style="@style/NotificationButton"
android:src="@drawable/notification_backward" />
app:srcCompat="@drawable/notification_backward" />
<ImageButton
android:id="@+id/control_pause"
style="@style/NotificationButton"
android:layout_width="54dip"
android:padding="0dip"
android:src="@drawable/notification_pause" />
app:srcCompat="@drawable/notification_pause" />
<ImageButton
android:id="@+id/control_next"
style="@style/NotificationButton"
android:src="@drawable/notification_forward" />
app:srcCompat="@drawable/notification_forward" />
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="128dp"
android:orientation="horizontal">
@ -38,7 +39,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:src="@drawable/notification_close"
app:srcCompat="@drawable/notification_close"
android:visibility="invisible" />
</LinearLayout>
@ -79,17 +80,17 @@
<ImageButton
android:id="@+id/control_previous"
style="@style/NotificationButton.Expanded"
android:src="@drawable/notification_backward" />
app:srcCompat="@drawable/notification_backward" />
<ImageButton
android:id="@+id/control_pause"
style="@style/NotificationButton.Expanded"
android:src="@drawable/notification_pause" />
app:srcCompat="@drawable/notification_pause" />
<ImageButton
android:id="@+id/control_next"
style="@style/NotificationButton.Expanded"
android:src="@drawable/notification_forward" />
app:srcCompat="@drawable/notification_forward" />
</LinearLayout>
</LinearLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
@ -8,7 +9,7 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:minHeight="?attr/listPreferredItemHeight"
android:orientation="horizontal"
android:paddingBottom="2dip"
android:paddingLeft="6dp"
@ -18,7 +19,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="?attr/select_server" />
app:srcCompat="?attr/select_server" />
<LinearLayout
android:layout_width="wrap_content"

View File

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@id/drag_handle"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_height="?attr/listPreferredItemHeight"
android:background="?attr/selectableItemBackground"
android:orientation="horizontal">
@ -67,7 +68,7 @@
android:layout_width="@dimen/SongStatusIcon"
android:layout_height="@dimen/SongStatusIcon"
android:layout_gravity="top"
android:src="?attr/downloading"
app:srcCompat="?attr/downloading"
android:visibility="gone" />
</LinearLayout>
@ -110,5 +111,5 @@
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="right|center_vertical"
android:src="?attr/download_none" />
app:srcCompat="?attr/download_none" />
</LinearLayout>

View File

@ -6,19 +6,19 @@
<style name="NotificationText.Content" parent="@android:style/TextAppearance.Material.Notification" />
<style name="NotificationButton" parent="NotificationButtonBase">
<item name="android:background">?android:selectableItemBackgroundBorderless</item>
<item name="background">?attr/selectableItemBackgroundBorderless</item>
</style>
<style name="NotificationButton.Expanded" parent="@style/NotificationButton.ExpandedBase">
<item name="android:padding">2dip</item>
<item name="android:background">?android:selectableItemBackgroundBorderless</item>
<item name="background">?attr/selectableItemBackgroundBorderless</item>
</style>
<style name="NotificationLayoutDivider">
<item name="android:divider">@drawable/notification_divider</item>
<item name="divider">@drawable/notification_divider</item>
</style>
<style name="NotificationDivider">
<item name="android:background">@drawable/notification_divider</item>
<item name="background">@drawable/notification_divider</item>
</style>
</resources>

View File

@ -2,11 +2,11 @@
<resources>
<style name="BasicButton">
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
<item name="background">?attr/selectableItemBackgroundBorderless</item>
</style>
<style name="NotificationButtonBase">
<item name="android:background">?android:selectableItemBackground</item>
<item name="background">?attr/selectableItemBackground</item>
<item name="android:layout_width">46dip</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_gravity">center</item>
@ -17,7 +17,7 @@
<style name="NotificationButton" parent="NotificationButtonBase" />
<style name="NotificationButton.ExpandedBase">
<item name="android:background">?android:selectableItemBackground</item>
<item name="background">?attr/selectableItemBackground</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_weight">1</item>
@ -34,11 +34,11 @@
<style name="NotificationText.Content" parent="@android:style/TextAppearance.StatusBar.EventContent" />
<style name="NotificationLayoutDivider">
<item name="android:divider">?android:listDivider</item>
<item name="divider">?android:listDivider</item>
</style>
<style name="NotificationDivider">
<item name="android:background">?android:dividerHorizontal</item>
<item name="background">?attr/dividerHorizontal</item>
</style>
<style name="MoreButton" parent="@style/BasicButton">