mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-10-19 01:39:39 +02:00
*** WIP ***
This commit is contained in:
parent
d60d10ddb1
commit
a0e6ee490e
@ -28,6 +28,7 @@ import android.widget.Filter;
|
||||
import android.widget.Filterable;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@ -105,7 +106,7 @@ public class AppBlacklistAdapter extends RecyclerView.Adapter<AppBlacklistAdapte
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
((CheckedTextView) view).toggle();
|
||||
if ( ((CheckedTextView)view).isChecked() ) {
|
||||
if (((CheckedTextView) view).isChecked()) {
|
||||
GBApplication.addAppToPebbleBlacklist(appInfo.packageName);
|
||||
} else {
|
||||
GBApplication.removeFromAppsPebbleBlacklist(appInfo.packageName);
|
||||
@ -126,6 +127,13 @@ public class AppBlacklistAdapter extends RecyclerView.Adapter<AppBlacklistAdapte
|
||||
}
|
||||
});
|
||||
|
||||
holder.btnConfigureApp.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Toast.makeText(mContext, "Configure clicked for: " + mNameMap.get(appInfo), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void blacklistAllNotif() {
|
||||
@ -163,15 +171,17 @@ public class AppBlacklistAdapter extends RecyclerView.Adapter<AppBlacklistAdapte
|
||||
final ImageView deviceImageView;
|
||||
final TextView deviceAppVersionAuthorLabel;
|
||||
final TextView deviceAppNameLabel;
|
||||
final ImageView btnConfigureApp;
|
||||
|
||||
AppBLViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
blacklist_checkbox = (CheckedTextView) itemView.findViewById(R.id.item_checkbox);
|
||||
blacklist_pebble_checkbox = (CheckedTextView) itemView.findViewById(R.id.item_pebble_checkbox);
|
||||
deviceImageView = (ImageView) itemView.findViewById(R.id.item_image);
|
||||
deviceAppVersionAuthorLabel = (TextView) itemView.findViewById(R.id.item_details);
|
||||
deviceAppNameLabel = (TextView) itemView.findViewById(R.id.item_name);
|
||||
blacklist_checkbox = itemView.findViewById(R.id.item_checkbox);
|
||||
blacklist_pebble_checkbox = itemView.findViewById(R.id.item_pebble_checkbox);
|
||||
deviceImageView = itemView.findViewById(R.id.item_image);
|
||||
deviceAppVersionAuthorLabel = itemView.findViewById(R.id.item_details);
|
||||
deviceAppNameLabel = itemView.findViewById(R.id.item_name);
|
||||
btnConfigureApp = itemView.findViewById(R.id.btn_configureApp);
|
||||
}
|
||||
|
||||
}
|
||||
|
5
app/src/main/res/drawable/ic_menu.xml
Normal file
5
app/src/main/res/drawable/ic_menu.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#7E7E7E"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
|
||||
</vector>
|
@ -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="wrap_content"
|
||||
android:background="?android:attr/activatedBackgroundIndicator"
|
||||
@ -14,10 +15,10 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/blacklist_checkboxes"
|
||||
android:drawableTop="?android:attr/listChoiceIndicatorMultiple"
|
||||
android:text="NOTIF"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/blacklist_checkboxes" />
|
||||
|
||||
<android.support.v7.widget.AppCompatCheckedTextView
|
||||
android:id="@+id/item_pebble_checkbox"
|
||||
@ -27,10 +28,10 @@
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_toEndOf="@+id/item_checkbox"
|
||||
android:textColor="@color/blacklist_checkboxes"
|
||||
android:drawableTop="?android:attr/listChoiceIndicatorMultiple"
|
||||
android:text="PEBBLE"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/blacklist_checkboxes" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_image"
|
||||
@ -48,17 +49,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@+id/item_image"
|
||||
android:layout_toLeftOf="@+id/btn_configureApp"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_name"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollHorizontally="false"
|
||||
android:maxLines="1"
|
||||
android:text="Item Name" />
|
||||
android:scrollHorizontally="false"
|
||||
android:text="Item Name"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_details"
|
||||
@ -68,4 +70,14 @@
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_configureApp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
app:srcCompat="@drawable/ic_menu" />
|
||||
|
||||
</RelativeLayout>
|
Loading…
Reference in New Issue
Block a user