Loading src/com/android/documentsui/BaseActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ public abstract class BaseActivity // ToDo Create tool to check resource version before applyStyle for the theme // If version code is not match, we should reset overlay package to default, // in case Activity continueusly encounter resource not found exception getThemedContext().getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); super.onCreate(icicle); Loading src/com/android/documentsui/dirlist/AppsRowManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ public class AppsRowManager { final LinearLayout appsGroup = activity.findViewById(R.id.apps_group); appsGroup.removeAllViews(); final LayoutInflater inflater = LayoutInflater.from(activity.getThemedContext()); final LayoutInflater inflater = activity.getLayoutInflater(); for (AppsRowItemData data : mDataList) { View item = inflater.inflate(R.layout.apps_item, appsGroup, false); bindView(item, data); Loading src/com/android/documentsui/inspector/InspectorActivity.java +1 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.documentsui.inspector; import static androidx.core.util.Preconditions.checkArgument; import android.app.Activity; import android.content.Intent; import android.content.res.Resources; import android.content.res.TypedArray; Loading Loading @@ -53,7 +52,7 @@ public class InspectorActivity extends AppCompatActivity { // ToDo Create tool to check resource version before applyStyle for the theme // If version code is not match, we should reset overlay package to default, // in case Activity continueusly encounter resource not found exception getThemedContext().getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); setContentView(R.layout.inspector_activity); Loading tests/unit/com/android/documentsui/dirlist/AppsRowManagerTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -65,12 +65,13 @@ public class AppsRowManagerTest { mAppsRowManager = new AppsRowManager(mActionHandler); Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); LayoutInflater layoutInflater = LayoutInflater.from(context); mState = new State(); mActivity = mock(BaseActivity.class); mAppsRow = LayoutInflater.from(context).inflate(R.layout.apps_row, null); mAppsRow = layoutInflater.inflate(R.layout.apps_row, null); mAppsGroup = mAppsRow.findViewById(R.id.apps_row); when(mActivity.getThemedContext()).thenReturn(context); when(mActivity.getLayoutInflater()).thenReturn(layoutInflater); when(mActivity.getDisplayState()).thenReturn(mState); when(mActivity.findViewById(R.id.apps_row)).thenReturn(mAppsRow); when(mActivity.findViewById(R.id.apps_group)).thenReturn(mAppsGroup); Loading Loading
src/com/android/documentsui/BaseActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ public abstract class BaseActivity // ToDo Create tool to check resource version before applyStyle for the theme // If version code is not match, we should reset overlay package to default, // in case Activity continueusly encounter resource not found exception getThemedContext().getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); super.onCreate(icicle); Loading
src/com/android/documentsui/dirlist/AppsRowManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ public class AppsRowManager { final LinearLayout appsGroup = activity.findViewById(R.id.apps_group); appsGroup.removeAllViews(); final LayoutInflater inflater = LayoutInflater.from(activity.getThemedContext()); final LayoutInflater inflater = activity.getLayoutInflater(); for (AppsRowItemData data : mDataList) { View item = inflater.inflate(R.layout.apps_item, appsGroup, false); bindView(item, data); Loading
src/com/android/documentsui/inspector/InspectorActivity.java +1 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.documentsui.inspector; import static androidx.core.util.Preconditions.checkArgument; import android.app.Activity; import android.content.Intent; import android.content.res.Resources; import android.content.res.TypedArray; Loading Loading @@ -53,7 +52,7 @@ public class InspectorActivity extends AppCompatActivity { // ToDo Create tool to check resource version before applyStyle for the theme // If version code is not match, we should reset overlay package to default, // in case Activity continueusly encounter resource not found exception getThemedContext().getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); getTheme().applyStyle(R.style.DocumentsDefaultTheme, false); setContentView(R.layout.inspector_activity); Loading
tests/unit/com/android/documentsui/dirlist/AppsRowManagerTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -65,12 +65,13 @@ public class AppsRowManagerTest { mAppsRowManager = new AppsRowManager(mActionHandler); Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); LayoutInflater layoutInflater = LayoutInflater.from(context); mState = new State(); mActivity = mock(BaseActivity.class); mAppsRow = LayoutInflater.from(context).inflate(R.layout.apps_row, null); mAppsRow = layoutInflater.inflate(R.layout.apps_row, null); mAppsGroup = mAppsRow.findViewById(R.id.apps_row); when(mActivity.getThemedContext()).thenReturn(context); when(mActivity.getLayoutInflater()).thenReturn(layoutInflater); when(mActivity.getDisplayState()).thenReturn(mState); when(mActivity.findViewById(R.id.apps_row)).thenReturn(mAppsRow); when(mActivity.findViewById(R.id.apps_group)).thenReturn(mAppsGroup); Loading