Loading packages/CompanionDeviceManager/res/layout/activity_confirmation.xml +99 −84 Original line number Diff line number Diff line Loading @@ -12,8 +12,15 @@ See the License for the specific language governing permissions and limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/activity_confirmation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:minWidth="340dp"> <LinearLayout android:id="@+id/association_confirmation" style="@style/ContainerLayout"> <!-- A header for selfManaged devices only. --> Loading Loading @@ -77,14 +84,9 @@ android:layout_height="wrap_content" /> <ProgressBar android:id="@+id/spinner" android:layout_width="56dp" android:layout_height="56dp" android:layout_centerInParent="true" android:indeterminate="true" android:tint="@android:color/system_accent1_600" android:id="@+id/spinner_multiple_device" android:visibility="gone" style="?android:attr/progressBarStyleLarge" /> style="@style/Spinner" /> </RelativeLayout> Loading Loading @@ -129,3 +131,16 @@ </LinearLayout> </LinearLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1"> <ProgressBar android:id="@+id/spinner_single_device" android:visibility="gone" style="@style/Spinner" /> </RelativeLayout>> </LinearLayout> No newline at end of file packages/CompanionDeviceManager/res/values/styles.xml +7 −0 Original line number Diff line number Diff line Loading @@ -108,4 +108,11 @@ <item name="android:background">@android:color/system_accent1_300</item> </style> <style name="Spinner" parent="@android:style/Widget.Material.Light.ProgressBar.Large"> <item name="android:layout_width">56dp</item> <item name="android:layout_height">56dp</item> <item name="android:indeterminate">true</item> <item name="android:layout_centerInParent">true</item> </style> </resources> No newline at end of file packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java +13 −5 Original line number Diff line number Diff line Loading @@ -122,7 +122,10 @@ public class CompanionDeviceActivity extends FragmentActivity implements // Progress indicator is only shown while we are looking for the first suitable device for a // multiple device association. private ProgressBar mProgressIndicator; private ProgressBar mMultipleDeviceSpinner; // Progress indicator is only shown while we are looking for the first suitable device for a // single device association. private ProgressBar mSingleDeviceSpinner; // Present for self-managed association requests and "single-device" regular association // regular. Loading Loading @@ -255,7 +258,7 @@ public class CompanionDeviceActivity extends FragmentActivity implements setContentView(R.layout.activity_confirmation); mMultipleDeviceList = findViewById(R.id.multiple_device_list); mAssociationConfirmationDialog = findViewById(R.id.activity_confirmation); mAssociationConfirmationDialog = findViewById(R.id.association_confirmation); mVendorHeader = findViewById(R.id.vendor_header); mTitle = findViewById(R.id.title); Loading @@ -269,7 +272,8 @@ public class CompanionDeviceActivity extends FragmentActivity implements mDeviceListRecyclerView = findViewById(R.id.device_list); mProgressIndicator = findViewById(R.id.spinner); mMultipleDeviceSpinner = findViewById(R.id.spinner_multiple_device); mSingleDeviceSpinner = findViewById(R.id.spinner_single_device); mDeviceAdapter = new DeviceListAdapter(this, this::onListItemClick); mPermissionListRecyclerView = findViewById(R.id.permission_list); Loading Loading @@ -468,8 +472,10 @@ public class CompanionDeviceActivity extends FragmentActivity implements deviceFilterPairs -> updateSingleDeviceUi( deviceFilterPairs, deviceProfile, appLabel)); mSingleDeviceSpinner.setVisibility(View.VISIBLE); mPermissionListRecyclerView.setVisibility(View.GONE); mDeviceListRecyclerView.setVisibility(View.GONE); mAssociationConfirmationDialog.setVisibility(View.GONE); } private void updateSingleDeviceUi(List<DeviceFilterPair<?>> deviceFilterPairs, Loading Loading @@ -499,6 +505,8 @@ public class CompanionDeviceActivity extends FragmentActivity implements mTitle.setText(title); mSummary.setText(summary); mProfileIcon.setImageDrawable(profileIcon); mSingleDeviceSpinner.setVisibility(View.GONE); mAssociationConfirmationDialog.setVisibility(View.VISIBLE); } private void initUiForMultipleDevices(CharSequence appLabel) { Loading Loading @@ -535,7 +543,7 @@ public class CompanionDeviceActivity extends FragmentActivity implements deviceFilterPairs -> { // Dismiss the progress bar once there's one device found for multiple devices. if (deviceFilterPairs.size() >= 1) { mProgressIndicator.setVisibility(View.GONE); mMultipleDeviceSpinner.setVisibility(View.GONE); } mDeviceAdapter.setDevices(deviceFilterPairs); Loading @@ -546,7 +554,7 @@ public class CompanionDeviceActivity extends FragmentActivity implements mButtonNotAllow.setVisibility(View.GONE); mButtonNotAllowMultipleDevices.setVisibility(View.VISIBLE); mMultipleDeviceList.setVisibility(View.VISIBLE); mProgressIndicator.setVisibility(View.VISIBLE); mMultipleDeviceSpinner.setVisibility(View.VISIBLE); } private void onListItemClick(int position) { Loading Loading
packages/CompanionDeviceManager/res/layout/activity_confirmation.xml +99 −84 Original line number Diff line number Diff line Loading @@ -12,8 +12,15 @@ See the License for the specific language governing permissions and limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/activity_confirmation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:minWidth="340dp"> <LinearLayout android:id="@+id/association_confirmation" style="@style/ContainerLayout"> <!-- A header for selfManaged devices only. --> Loading Loading @@ -77,14 +84,9 @@ android:layout_height="wrap_content" /> <ProgressBar android:id="@+id/spinner" android:layout_width="56dp" android:layout_height="56dp" android:layout_centerInParent="true" android:indeterminate="true" android:tint="@android:color/system_accent1_600" android:id="@+id/spinner_multiple_device" android:visibility="gone" style="?android:attr/progressBarStyleLarge" /> style="@style/Spinner" /> </RelativeLayout> Loading Loading @@ -129,3 +131,16 @@ </LinearLayout> </LinearLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1"> <ProgressBar android:id="@+id/spinner_single_device" android:visibility="gone" style="@style/Spinner" /> </RelativeLayout>> </LinearLayout> No newline at end of file
packages/CompanionDeviceManager/res/values/styles.xml +7 −0 Original line number Diff line number Diff line Loading @@ -108,4 +108,11 @@ <item name="android:background">@android:color/system_accent1_300</item> </style> <style name="Spinner" parent="@android:style/Widget.Material.Light.ProgressBar.Large"> <item name="android:layout_width">56dp</item> <item name="android:layout_height">56dp</item> <item name="android:indeterminate">true</item> <item name="android:layout_centerInParent">true</item> </style> </resources> No newline at end of file
packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java +13 −5 Original line number Diff line number Diff line Loading @@ -122,7 +122,10 @@ public class CompanionDeviceActivity extends FragmentActivity implements // Progress indicator is only shown while we are looking for the first suitable device for a // multiple device association. private ProgressBar mProgressIndicator; private ProgressBar mMultipleDeviceSpinner; // Progress indicator is only shown while we are looking for the first suitable device for a // single device association. private ProgressBar mSingleDeviceSpinner; // Present for self-managed association requests and "single-device" regular association // regular. Loading Loading @@ -255,7 +258,7 @@ public class CompanionDeviceActivity extends FragmentActivity implements setContentView(R.layout.activity_confirmation); mMultipleDeviceList = findViewById(R.id.multiple_device_list); mAssociationConfirmationDialog = findViewById(R.id.activity_confirmation); mAssociationConfirmationDialog = findViewById(R.id.association_confirmation); mVendorHeader = findViewById(R.id.vendor_header); mTitle = findViewById(R.id.title); Loading @@ -269,7 +272,8 @@ public class CompanionDeviceActivity extends FragmentActivity implements mDeviceListRecyclerView = findViewById(R.id.device_list); mProgressIndicator = findViewById(R.id.spinner); mMultipleDeviceSpinner = findViewById(R.id.spinner_multiple_device); mSingleDeviceSpinner = findViewById(R.id.spinner_single_device); mDeviceAdapter = new DeviceListAdapter(this, this::onListItemClick); mPermissionListRecyclerView = findViewById(R.id.permission_list); Loading Loading @@ -468,8 +472,10 @@ public class CompanionDeviceActivity extends FragmentActivity implements deviceFilterPairs -> updateSingleDeviceUi( deviceFilterPairs, deviceProfile, appLabel)); mSingleDeviceSpinner.setVisibility(View.VISIBLE); mPermissionListRecyclerView.setVisibility(View.GONE); mDeviceListRecyclerView.setVisibility(View.GONE); mAssociationConfirmationDialog.setVisibility(View.GONE); } private void updateSingleDeviceUi(List<DeviceFilterPair<?>> deviceFilterPairs, Loading Loading @@ -499,6 +505,8 @@ public class CompanionDeviceActivity extends FragmentActivity implements mTitle.setText(title); mSummary.setText(summary); mProfileIcon.setImageDrawable(profileIcon); mSingleDeviceSpinner.setVisibility(View.GONE); mAssociationConfirmationDialog.setVisibility(View.VISIBLE); } private void initUiForMultipleDevices(CharSequence appLabel) { Loading Loading @@ -535,7 +543,7 @@ public class CompanionDeviceActivity extends FragmentActivity implements deviceFilterPairs -> { // Dismiss the progress bar once there's one device found for multiple devices. if (deviceFilterPairs.size() >= 1) { mProgressIndicator.setVisibility(View.GONE); mMultipleDeviceSpinner.setVisibility(View.GONE); } mDeviceAdapter.setDevices(deviceFilterPairs); Loading @@ -546,7 +554,7 @@ public class CompanionDeviceActivity extends FragmentActivity implements mButtonNotAllow.setVisibility(View.GONE); mButtonNotAllowMultipleDevices.setVisibility(View.VISIBLE); mMultipleDeviceList.setVisibility(View.VISIBLE); mProgressIndicator.setVisibility(View.VISIBLE); mMultipleDeviceSpinner.setVisibility(View.VISIBLE); } private void onListItemClick(int position) { Loading