From 6083bb4b89ff91966b20acdc78258f0818058f3e Mon Sep 17 00:00:00 2001 From: Andries Smit Date: Mon, 6 Dec 2021 20:45:29 +0100 Subject: [PATCH] Wear improve action menu --- .../interaction/menus/FillMenuActivity.java | 21 +- .../interaction/menus/MainMenuActivity.java | 31 ++- .../interaction/menus/StatusMenuActivity.java | 20 +- .../interaction/utils/MenuListActivity.java | 186 ++++++++---------- .../utils/WearableListItemLayout.java | 54 ----- wear/src/main/res/drawable/ic_bolus.xml | 13 ++ wear/src/main/res/drawable/ic_calculator.xml | 24 +-- wear/src/main/res/drawable/ic_canula.xml | 17 +- wear/src/main/res/drawable/ic_e_carbs.xml | 13 ++ wear/src/main/res/drawable/ic_loop_closed.xml | 12 ++ wear/src/main/res/drawable/ic_settings.xml | 13 +- wear/src/main/res/drawable/ic_sync.xml | 13 +- wear/src/main/res/drawable/ic_tdd.xml | 13 ++ wear/src/main/res/drawable/ic_temptarget.xml | 17 +- .../main/res/drawable/menu_item_layout_bg.xml | 11 ++ wear/src/main/res/layout-v26/list_item.xml | 49 +++-- .../main/res/layout/actions_list_activity.xml | 41 ++-- wear/src/main/res/layout/grid_layout.xml | 2 +- wear/src/main/res/layout/list_item.xml | 54 ++--- 19 files changed, 314 insertions(+), 290 deletions(-) delete mode 100644 wear/src/main/java/info/nightscout/androidaps/interaction/utils/WearableListItemLayout.java create mode 100644 wear/src/main/res/drawable/ic_bolus.xml create mode 100644 wear/src/main/res/drawable/ic_e_carbs.xml create mode 100644 wear/src/main/res/drawable/ic_loop_closed.xml create mode 100644 wear/src/main/res/drawable/ic_tdd.xml create mode 100644 wear/src/main/res/drawable/menu_item_layout_bg.xml diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/FillMenuActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/menus/FillMenuActivity.java index fc3613c227..92f557268f 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/FillMenuActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/menus/FillMenuActivity.java @@ -1,6 +1,7 @@ package info.nightscout.androidaps.interaction.menus; import android.content.Intent; +import android.os.Bundle; import java.util.ArrayList; import java.util.List; @@ -17,14 +18,20 @@ import info.nightscout.androidaps.interaction.utils.MenuListActivity; public class FillMenuActivity extends MenuListActivity { @Override - protected List getElements() { - List menuitems = new ArrayList<>(); - menuitems.add(new MenuElement(R.drawable.ic_canula, getString(R.string.action_preset_1))); - menuitems.add(new MenuElement(R.drawable.ic_canula, getString(R.string.action_preset_2))); - menuitems.add(new MenuElement(R.drawable.ic_canula, getString(R.string.action_preset_3))); - menuitems.add(new MenuElement(R.drawable.ic_canula, getString(R.string.action_free_amount))); + protected void onCreate(Bundle savedInstanceState) { + setTitle(R.string.menu_prime_fill); + super.onCreate(savedInstanceState); + } - return menuitems; + @Override + protected List getElements() { + List menuItems = new ArrayList<>(); + menuItems.add(new MenuItem(R.drawable.ic_canula, getString(R.string.action_preset_1))); + menuItems.add(new MenuItem(R.drawable.ic_canula, getString(R.string.action_preset_2))); + menuItems.add(new MenuItem(R.drawable.ic_canula, getString(R.string.action_preset_3))); + menuItems.add(new MenuItem(R.drawable.ic_canula, getString(R.string.action_free_amount))); + + return menuItems; } @Override diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/MainMenuActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/menus/MainMenuActivity.java index a37d612627..b0180cf017 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/MainMenuActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/menus/MainMenuActivity.java @@ -7,7 +7,6 @@ import android.preference.PreferenceManager; import java.util.ArrayList; import java.util.List; -import java.util.Vector; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.ListenerService; @@ -29,35 +28,35 @@ public class MainMenuActivity extends MenuListActivity { @Override protected void onCreate(Bundle savedInstanceState) { sp = PreferenceManager.getDefaultSharedPreferences(this); + setTitle(R.string.label_actions_activity); super.onCreate(savedInstanceState); ListenerService.requestData(this); } @Override - protected List getElements() { - SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); + protected List getElements() { - List menuitems = new ArrayList<>(); - if (!sharedPreferences.getBoolean("wearcontrol", false)) { - menuitems.add(new MenuElement(R.drawable.ic_settings, getString(R.string.menu_settings))); - menuitems.add(new MenuElement(R.drawable.ic_sync, getString(R.string.menu_resync))); + List menuItems = new ArrayList<>(); + if (!sp.getBoolean("wearcontrol", false)) { + menuItems.add(new MenuItem(R.drawable.ic_settings, getString(R.string.menu_settings))); + menuItems.add(new MenuItem(R.drawable.ic_sync, getString(R.string.menu_resync))); - return menuitems; + return menuItems; } boolean showPrimeFill = sp.getBoolean("primefill", false); boolean showWizard = sp.getBoolean("showWizard", true); - menuitems.add(new MenuElement(R.drawable.ic_temptarget, getString(R.string.menu_tempt))); - if (showWizard) menuitems.add(new MenuElement(R.drawable.ic_calculator, getString(R.string.menu_wizard))); - menuitems.add(new MenuElement(R.drawable.ic_carbs, getString(R.string.menu_ecarb))); - menuitems.add(new MenuElement(R.drawable.ic_cob_iob, getString(R.string.menu_bolus))); - menuitems.add(new MenuElement(R.drawable.ic_settings, getString(R.string.menu_settings))); - menuitems.add(new MenuElement(R.drawable.ic_status, getString(R.string.menu_status))); - if (showPrimeFill) menuitems.add(new MenuElement(R.drawable.ic_canula, getString(R.string.menu_prime_fill))); + if (showWizard) menuItems.add(new MenuItem(R.drawable.ic_calculator, getString(R.string.menu_wizard))); + menuItems.add(new MenuItem(R.drawable.ic_e_carbs, getString(R.string.menu_ecarb))); + menuItems.add(new MenuItem(R.drawable.ic_bolus, getString(R.string.menu_bolus))); + menuItems.add(new MenuItem(R.drawable.ic_temptarget, getString(R.string.menu_tempt))); + menuItems.add(new MenuItem(R.drawable.ic_settings, getString(R.string.menu_settings))); + menuItems.add(new MenuItem(R.drawable.ic_status, getString(R.string.menu_status))); + if (showPrimeFill) menuItems.add(new MenuItem(R.drawable.ic_canula, getString(R.string.menu_prime_fill))); - return menuitems; + return menuItems; } @Override diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/StatusMenuActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/menus/StatusMenuActivity.java index 73ffb8b019..8861e45ed6 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/menus/StatusMenuActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/menus/StatusMenuActivity.java @@ -1,5 +1,7 @@ package info.nightscout.androidaps.interaction.menus; +import android.os.Bundle; + import java.util.ArrayList; import java.util.List; @@ -14,12 +16,18 @@ import info.nightscout.androidaps.interaction.utils.MenuListActivity; public class StatusMenuActivity extends MenuListActivity { @Override - protected List getElements() { - List menuitems = new ArrayList<>(); - menuitems.add(new MenuElement(R.drawable.ic_status, getString(R.string.status_pump))); - menuitems.add(new MenuElement(R.drawable.ic_loop_closed_white, getString(R.string.status_loop))); - menuitems.add(new MenuElement(R.drawable.ic_status, getString(R.string.status_cpp))); - menuitems.add(new MenuElement(R.drawable.ic_iob_detailed, getString(R.string.status_tdd))); + protected void onCreate(Bundle savedInstanceState) { + setTitle(R.string.menu_status); + super.onCreate(savedInstanceState); + } + + @Override + protected List getElements() { + List menuitems = new ArrayList<>(); + menuitems.add(new MenuItem(R.drawable.ic_status, getString(R.string.status_pump))); + menuitems.add(new MenuItem(R.drawable.ic_loop_closed, getString(R.string.status_loop))); + menuitems.add(new MenuItem(R.drawable.ic_status, getString(R.string.status_cpp))); + menuitems.add(new MenuItem(R.drawable.ic_tdd, getString(R.string.status_tdd))); return menuitems; } diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/MenuListActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/MenuListActivity.java index e9302f8b23..c9184a61f0 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/MenuListActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/MenuListActivity.java @@ -1,16 +1,18 @@ package info.nightscout.androidaps.interaction.utils; import android.app.Activity; -import android.content.Context; import android.os.Bundle; -import android.support.wearable.view.WearableListView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.FrameLayout; import android.widget.ImageView; +import android.widget.RelativeLayout; import android.widget.TextView; +import androidx.recyclerview.widget.RecyclerView; +import androidx.wear.widget.WearableLinearLayoutManager; +import androidx.wear.widget.WearableRecyclerView; + import java.util.List; import info.nightscout.androidaps.R; @@ -19,147 +21,113 @@ import info.nightscout.androidaps.R; * Created by adrian on 08/02/17. */ -public abstract class MenuListActivity extends Activity - implements WearableListView.ClickListener { - - List elements; - - protected abstract List getElements(); - +public abstract class MenuListActivity extends Activity { + List elements; + protected abstract List getElements(); protected abstract void doAction(String position); + public interface AdapterCallback{ + void onItemClicked(MenuAdapter.ItemViewHolder v); + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - elements = getElements(); setContentView(R.layout.actions_list_activity); + TextView titleView = findViewById(R.id.title); + titleView.setText(getTitle()); - // Get the list component from the layout of the activity - WearableListView listView = - findViewById(R.id.wearable_list); - - // Assign an adapter to the list - listView.setAdapter(new MenuAdapter(this, elements)); - - // Set a click listener - listView.setClickListener(this); + elements = getElements(); + CustomScrollingLayoutCallback customScrollingLayoutCallback = new CustomScrollingLayoutCallback(); + WearableLinearLayoutManager layoutManager = new WearableLinearLayoutManager(this); + if (this.getResources().getConfiguration().isScreenRound()) { + layoutManager.setLayoutCallback(customScrollingLayoutCallback); + } + WearableRecyclerView listView = findViewById(R.id.action_list); + listView.setHasFixedSize(true); + listView.setEdgeItemsCenteringEnabled(true); + listView.setLayoutManager(layoutManager); + listView.setAdapter(new MenuAdapter(elements, v -> { + String tag = (String) v.itemView.getTag(); + doAction(tag); + })); } - // WearableListView click listener - @Override - public void onClick(WearableListView.ViewHolder v) { - String tag = (String) v.itemView.getTag(); - doAction(tag); + private class MenuAdapter extends RecyclerView.Adapter { + private final List mDataset; + private AdapterCallback callback; - } - - @Override - public void onTopEmptyRegionClick() { - } - - - private class MenuAdapter extends WearableListView.Adapter { - private final List mDataset; - private final Context mContext; - private final LayoutInflater mInflater; - - // Provide a suitable constructor (depends on the kind of dataset) - public MenuAdapter(Context context, List dataset) { - mContext = context; - mInflater = LayoutInflater.from(context); + public MenuAdapter(List dataset, AdapterCallback callback) { mDataset = dataset; + this.callback = callback; } - // Provide a reference to the type of views you're using - public class ItemViewHolder extends WearableListView.ViewHolder { - private final TextView textView; + public class ItemViewHolder extends RecyclerView.ViewHolder { + protected final RelativeLayout menuContainer; + protected final TextView actionItem; + protected final ImageView actionIcon; public ItemViewHolder(View itemView) { super(itemView); - // find the text view within the custom item's layout - textView = itemView.findViewById(R.id.actionitem); + menuContainer = itemView.findViewById(R.id.menu_container); + actionItem = itemView.findViewById(R.id.menuItemText); + actionIcon = itemView.findViewById(R.id.menuItemIcon); } } - // Create new views for list items - // (invoked by the WearableListView's layout manager) @Override - public WearableListView.ViewHolder onCreateViewHolder(ViewGroup parent, - int viewType) { - // Inflate our custom layout for list items - WearableListView.ViewHolder viewHolder = new WearableListView.ViewHolder(new MenuItemView(mContext)); - return viewHolder; + public ItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item, parent, false); + ItemViewHolder recyclerViewHolder = new ItemViewHolder(view); + + return recyclerViewHolder; } - // Replace the contents of a list item - // Instead of creating new views, the list tries to recycle existing ones - // (invoked by the WearableListView's layout manager) @Override - public void onBindViewHolder(WearableListView.ViewHolder holder, - int position) { - // retrieve the text view - MenuItemView menuItemView = (MenuItemView) holder.itemView; - final MenuElement item = mDataset.get(position); - TextView textView = menuItemView.findViewById(R.id.actionitem); - textView.setText(item.actionitem); - - final ImageView imageView = menuItemView.findViewById(R.id.actionicon); - imageView.setImageResource(item.actionicon); - - // replace list item's metadata - holder.itemView.setTag(item.actionitem); + public void onBindViewHolder(ItemViewHolder holder, final int position) { + MenuItem item = mDataset.get(position); + holder.actionItem.setText(item.actionItem); + holder.actionIcon.setImageResource(item.actionIcon); + holder.itemView.setTag(item.actionItem); + holder.menuContainer.setOnClickListener(v -> { + callback.onItemClicked(holder); + }); } - // Return the size of your dataset - // (invoked by the WearableListView's layout manager) @Override public int getItemCount() { return mDataset.size(); } } - public final class MenuItemView extends FrameLayout implements WearableListView.OnCenterProximityListener { - - final ImageView image; - final TextView text; - final float scale = 0.8f; - final float alpha = 0.8f; - - public MenuItemView(Context context) { - super(context); - View.inflate(context, R.layout.list_item, this); - image = findViewById(R.id.actionicon); - text = findViewById(R.id.actionitem); - image.setScaleX(scale); - image.setScaleX(scale); - image.setAlpha(alpha); - text.setScaleX(scale); - text.setScaleX(scale); - text.setAlpha(alpha); - } - - @Override - public void onCenterPosition(boolean b) { - // Animation to be ran when the view becomes the centered one - image.animate().scaleX(1f).scaleY(1f).alpha(1); - text.animate().scaleX(1f).scaleY(1f).alpha(1); - } - - @Override - public void onNonCenterPosition(boolean b) { - //Animation to be ran when the view is not the centered one anymore - image.animate().scaleX(scale).scaleY(scale).alpha(alpha); - text.animate().scaleX(scale).scaleY(scale).alpha(alpha); + protected class MenuItem { + public MenuItem(int actionIcon, String actionItem) { + this.actionIcon = actionIcon; + this.actionItem = actionItem; } + public int actionIcon; + public String actionItem; } - protected class MenuElement { - public MenuElement(int actionicon, String actionitem) { - this.actionicon = actionicon; - this.actionitem = actionitem; + public class CustomScrollingLayoutCallback extends WearableLinearLayoutManager.LayoutCallback { + // How much should we scale the icon at most. + private static final float MAX_ICON_PROGRESS = 0.65f; + private float progressToCenter; + + @Override + public void onLayoutFinished(View child, RecyclerView parent) { + // Figure out % progress from top to bottom + float centerOffset = ((float) child.getHeight() / 2.0f) / (float) parent.getHeight(); + float yRelativeToCenterOffset = (child.getY() / parent.getHeight()) + centerOffset; + + // Normalize for center + progressToCenter = Math.abs(0.5f - yRelativeToCenterOffset); + // Adjust to the maximum scale + progressToCenter = Math.min(progressToCenter, MAX_ICON_PROGRESS); + + child.setScaleX(1 - progressToCenter); + child.setScaleY(1 - progressToCenter); } - public int actionicon; - public String actionitem; } } diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/WearableListItemLayout.java b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/WearableListItemLayout.java deleted file mode 100644 index d135536e22..0000000000 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/WearableListItemLayout.java +++ /dev/null @@ -1,54 +0,0 @@ -package info.nightscout.androidaps.interaction.utils; - -import android.content.Context; -import android.support.wearable.view.WearableListView; -import android.util.AttributeSet; -import android.widget.LinearLayout; -import android.widget.TextView; - -import info.nightscout.androidaps.R; - -/** - * Created by adrian on 08/02/17. - */ - -public class WearableListItemLayout extends LinearLayout - implements WearableListView.OnCenterProximityListener { - - //private ImageView mCircle; - private TextView mName; - - private final float mFadedTextAlpha; - - public WearableListItemLayout(Context context) { - this(context, null); - } - - public WearableListItemLayout(Context context, AttributeSet attrs) { - this(context, attrs, 0); - } - - public WearableListItemLayout(Context context, AttributeSet attrs, - int defStyle) { - super(context, attrs, defStyle); - - mFadedTextAlpha = 40 / 100f; - } - - // Get references to the icon and text in the item layout definition - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - mName = findViewById(R.id.actionitem); - } - - @Override - public void onCenterPosition(boolean animate) { - mName.setAlpha(1f); - } - - @Override - public void onNonCenterPosition(boolean animate) { - mName.setAlpha(mFadedTextAlpha); - } -} diff --git a/wear/src/main/res/drawable/ic_bolus.xml b/wear/src/main/res/drawable/ic_bolus.xml new file mode 100644 index 0000000000..1daf871f0c --- /dev/null +++ b/wear/src/main/res/drawable/ic_bolus.xml @@ -0,0 +1,13 @@ + + + + diff --git a/wear/src/main/res/drawable/ic_calculator.xml b/wear/src/main/res/drawable/ic_calculator.xml index 2538ed034b..a147eaac56 100644 --- a/wear/src/main/res/drawable/ic_calculator.xml +++ b/wear/src/main/res/drawable/ic_calculator.xml @@ -1,14 +1,16 @@ - - - - - - - - + android:viewportHeight="30" + android:viewportWidth="30"> + + + + + + + + diff --git a/wear/src/main/res/drawable/ic_canula.xml b/wear/src/main/res/drawable/ic_canula.xml index 8d20fa6864..29e1e43d9b 100644 --- a/wear/src/main/res/drawable/ic_canula.xml +++ b/wear/src/main/res/drawable/ic_canula.xml @@ -1,9 +1,12 @@ - + android:height="48dp" + android:width="48dp" + android:viewportHeight="30" + android:viewportWidth="30"> + + diff --git a/wear/src/main/res/drawable/ic_e_carbs.xml b/wear/src/main/res/drawable/ic_e_carbs.xml new file mode 100644 index 0000000000..047623e21e --- /dev/null +++ b/wear/src/main/res/drawable/ic_e_carbs.xml @@ -0,0 +1,13 @@ + + + + diff --git a/wear/src/main/res/drawable/ic_loop_closed.xml b/wear/src/main/res/drawable/ic_loop_closed.xml new file mode 100644 index 0000000000..68d6690445 --- /dev/null +++ b/wear/src/main/res/drawable/ic_loop_closed.xml @@ -0,0 +1,12 @@ + + + + diff --git a/wear/src/main/res/drawable/ic_settings.xml b/wear/src/main/res/drawable/ic_settings.xml index b833ab6c7c..30858cc88a 100644 --- a/wear/src/main/res/drawable/ic_settings.xml +++ b/wear/src/main/res/drawable/ic_settings.xml @@ -1,9 +1,12 @@ + android:height="48dp" + android:width="48dp" + android:viewportHeight="30" + android:viewportWidth="30"> + + android:pathData="M 22.14 15.94 c 0.04 -0.3 0.06 -0.61 0.06 -0.94 c 0 -0.32 -0.02 -0.64 -0.07 -0.94 l 2.03 -1.58 c 0.18 -0.14 0.23 -0.41 0.12 -0.61 l -1.92 -3.32 c -0.12 -0.22 -0.37 -0.29 -0.59 -0.22 l -2.39 0.96 c -0.5 -0.38 -1.03 -0.7 -1.62 -0.94 L 17.4 5.81 c -0.04 -0.24 -0.24 -0.41 -0.48 -0.41 h -3.84 c -0.24 0 -0.43 0.17 -0.47 0.41 L 12.25 8.35 C 11.66 8.59 11.12 8.92 10.63 9.29 L 8.24 8.33 c -0.22 -0.08 -0.47 0 -0.59 0.22 L 5.74 11.87 C 5.62 12.08 5.66 12.34 5.86 12.48 l 2.03 1.58 C 7.84 14.36 7.8 14.69 7.8 15 s 0.02 0.64 0.07 0.94 l -2.03 1.58 c -0.18 0.14 -0.23 0.41 -0.12 0.61 l 1.92 3.32 c 0.12 0.22 0.37 0.29 0.59 0.22 l 2.39 -0.96 c 0.5 0.38 1.03 0.7 1.62 0.94 l 0.36 2.54 c 0.05 0.24 0.24 0.41 0.48 0.41 h 3.84 c 0.24 0 0.44 -0.17 0.47 -0.41 l 0.36 -2.54 c 0.59 -0.24 1.13 -0.56 1.62 -0.94 l 2.39 0.96 c 0.22 0.08 0.47 0 0.59 -0.22 l 1.92 -3.32 c 0.12 -0.22 0.07 -0.47 -0.12 -0.61 L 22.14 15.94 z M 15 18.6 c -1.98 0 -3.6 -1.62 -3.6 -3.6 s 1.62 -3.6 3.6 -3.6 s 3.6 1.62 3.6 3.6 S 16.98 18.6 15 18.6 z"/> diff --git a/wear/src/main/res/drawable/ic_sync.xml b/wear/src/main/res/drawable/ic_sync.xml index 749430d0b6..5eacdb9105 100644 --- a/wear/src/main/res/drawable/ic_sync.xml +++ b/wear/src/main/res/drawable/ic_sync.xml @@ -1,9 +1,12 @@ + android:height="48dp" + android:width="48dp" + android:viewportHeight="30" + android:viewportWidth="30"> + + android:pathData="m 16 10.101 l 0.01 0.001 a 4.978 4.978 0 0 1 2.526 1.362 a 5.005 5.005 0 0 1 1.363 2.528 a 5.061 5.061 0 0 1 -0.001 2.016 a 4.976 4.976 0 0 1 -1.363 2.527 l 1.414 1.414 a 7.014 7.014 0 0 0 1.908 -3.54 a 6.98 6.98 0 0 0 0 -2.819 a 6.957 6.957 0 0 0 -1.907 -3.539 a 6.97 6.97 0 0 0 -2.223 -1.5 a 6.921 6.921 0 0 0 -1.315 -0.408 c -0.137 -0.028 -0.275 -0.043 -0.412 -0.063 V 5 L 12 9 l 4 4 V 10.101 z m -7.45 7.623 c 0.174 0.412 0.392 0.812 0.646 1.19 c 0.249 0.37 0.537 0.718 0.854 1.034 a 7.036 7.036 0 0 0 2.224 1.501 c 0.425 0.18 0.868 0.317 1.315 0.408 c 0.167 0.034 0.338 0.056 0.508 0.078 v 2.944 l 4 -4 l -4 -4 v 3.03 c -0.035 -0.006 -0.072 -0.003 -0.107 -0.011 a 4.978 4.978 0 0 1 -2.526 -1.362 a 4.994 4.994 0 0 1 0.001 -7.071 L 10.051 10.05 a 7.01 7.01 0 0 0 -1.5 2.224 A 6.974 6.974 0 0 0 8 15 a 6.997 6.997 0 0 0 0.55 2.724 z"/> diff --git a/wear/src/main/res/drawable/ic_tdd.xml b/wear/src/main/res/drawable/ic_tdd.xml new file mode 100644 index 0000000000..02d751c7bb --- /dev/null +++ b/wear/src/main/res/drawable/ic_tdd.xml @@ -0,0 +1,13 @@ + + + + diff --git a/wear/src/main/res/drawable/ic_temptarget.xml b/wear/src/main/res/drawable/ic_temptarget.xml index 5a1ed84c65..d1078f4d92 100644 --- a/wear/src/main/res/drawable/ic_temptarget.xml +++ b/wear/src/main/res/drawable/ic_temptarget.xml @@ -1,9 +1,12 @@ - + android:height="48dp" + android:width="48dp" + android:viewportHeight="30" + android:viewportWidth="30"> + + diff --git a/wear/src/main/res/drawable/menu_item_layout_bg.xml b/wear/src/main/res/drawable/menu_item_layout_bg.xml new file mode 100644 index 0000000000..9421db0f25 --- /dev/null +++ b/wear/src/main/res/drawable/menu_item_layout_bg.xml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/wear/src/main/res/layout-v26/list_item.xml b/wear/src/main/res/layout-v26/list_item.xml index aee08c036b..b40327f8a2 100644 --- a/wear/src/main/res/layout-v26/list_item.xml +++ b/wear/src/main/res/layout-v26/list_item.xml @@ -1,30 +1,37 @@ - + android:layout_height="wrap_content" + android:paddingBottom="8dp" + android:paddingTop="8dp" + android:background="@drawable/menu_item_layout_bg"> + + android:id="@+id/menuItemIcon" + android:layout_width="35dp" + android:layout_height="35dp" + android:layout_alignParentStart="true" + android:layout_alignParentLeft="true" + android:layout_centerVertical="true" + android:layout_marginStart="10dp" + android:src="@drawable/circle" /> + - + android:textStyle="bold" /> + diff --git a/wear/src/main/res/layout/actions_list_activity.xml b/wear/src/main/res/layout/actions_list_activity.xml index d9086a813c..c989dbbf33 100644 --- a/wear/src/main/res/layout/actions_list_activity.xml +++ b/wear/src/main/res/layout/actions_list_activity.xml @@ -1,22 +1,27 @@ - + - + android:layout_height="match_parent" + android:scrollbars="vertical" > + + - - - - - + + diff --git a/wear/src/main/res/layout/grid_layout.xml b/wear/src/main/res/layout/grid_layout.xml index 02731fd35e..7d0c41d95d 100644 --- a/wear/src/main/res/layout/grid_layout.xml +++ b/wear/src/main/res/layout/grid_layout.xml @@ -6,7 +6,7 @@ diff --git a/wear/src/main/res/layout/list_item.xml b/wear/src/main/res/layout/list_item.xml index 62bcf96129..538ff220f6 100644 --- a/wear/src/main/res/layout/list_item.xml +++ b/wear/src/main/res/layout/list_item.xml @@ -1,25 +1,33 @@ - - - - + android:layout_height="wrap_content" + android:paddingBottom="8dp" + android:paddingTop="8dp" + android:background="@drawable/menu_item_layout_bg"> + + + + +