Fix scrolling position not kept in Trusted Credentials

For example when changing display states.

Save view states to solve this issue.
 - Save current tab. (System / User)
 - Save group expanded state. (Personal / Work)
 - Save scrolling position of each group.

Also updated to ViewPager2 and updated the styles.

Bug: 204839552
Test: manual
Change-Id: Ibeda50b50e7dfd2ba071b75fe2aa88ef560f4c88
This commit is contained in:
Chaohui Wang
2022-04-09 21:45:04 +08:00
parent fbafdbdd8f
commit 3ce806d870
4 changed files with 1128 additions and 1047 deletions

View File

@@ -13,78 +13,26 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<TabHost <FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:id="@+id/system_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ProgressBar <ProgressBar
android:id="@+id/system_progress" android:id="@+id/progress"
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:visibility="gone"/> android:visibility="gone"/>
<LinearLayout <LinearLayout
android:id="@+id/system_content" android:id="@+id/content"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone" android:visibility="gone">
android:animateLayoutChanges="true">
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
<FrameLayout
android:id="@+id/user_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ProgressBar
android:id="@+id/user_progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:visibility="gone" />
<LinearLayout
android:id="@+id/user_content"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:animateLayoutChanges="true">
</LinearLayout>
</FrameLayout>
</FrameLayout>
</LinearLayout>
</TabHost>

View File

@@ -34,7 +34,7 @@ import android.widget.Spinner;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import com.android.internal.widget.LockPatternUtils; import com.android.internal.widget.LockPatternUtils;
import com.android.settings.TrustedCredentialsSettings.CertHolder; import com.android.settings.TrustedCredentialsFragment.CertHolder;
import com.android.settingslib.RestrictedLockUtils; import com.android.settingslib.RestrictedLockUtils;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff