Merge "Fix the background color of CollapsingToolbarLayout" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d355d7f123
@@ -17,6 +17,7 @@
|
||||
package com.android.settings.dashboard.profileselector;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.accounts.AccountPersonalDashboardFragment;
|
||||
import com.android.settings.accounts.AccountWorkProfileDashboardFragment;
|
||||
|
||||
@@ -32,4 +33,9 @@ public class ProfileSelectAccountFragment extends ProfileSelectFragment {
|
||||
new AccountWorkProfileDashboardFragment()
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.accounts_dashboard_settings_header;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +107,10 @@ public abstract class ProfileSelectFragment extends DashboardFragment {
|
||||
Bundle savedInstanceState) {
|
||||
mContentView = (ViewGroup) super.onCreateView(inflater, container, savedInstanceState);
|
||||
final Activity activity = getActivity();
|
||||
final int titleResId = getTitleResId();
|
||||
if (titleResId > 0) {
|
||||
activity.setTitle(titleResId);
|
||||
}
|
||||
final int selectedTab = convertPosition(getTabId(activity, getArguments()));
|
||||
|
||||
final View tabContainer = mContentView.findViewById(R.id.tab_container);
|
||||
@@ -166,6 +170,14 @@ public abstract class ProfileSelectFragment extends DashboardFragment {
|
||||
*/
|
||||
public abstract Fragment[] getFragments();
|
||||
|
||||
/**
|
||||
* Returns a resource ID of the title
|
||||
* Override this if the title needs to be updated dynamically.
|
||||
*/
|
||||
int getTitleResId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.placeholder_preference_screen;
|
||||
|
||||
@@ -60,4 +60,9 @@ public class ProfileSelectLocationFragment extends ProfileSelectFragment {
|
||||
workFragment
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.location_settings_header;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.location.LocationServices;
|
||||
import com.android.settings.location.LocationServicesForWork;
|
||||
|
||||
@@ -44,4 +45,9 @@ public class ProfileSelectLocationServicesFragment extends ProfileSelectFragment
|
||||
workFragment
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.location_services_header;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.settings.dashboard.profileselector;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
@@ -43,4 +45,12 @@ public class ProfileSelectManageApplications extends ProfileSelectFragment {
|
||||
workFragment
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
int getTitleResId() {
|
||||
final Activity activity = getActivity();
|
||||
final Intent intent = activity.getIntent();
|
||||
final Bundle args = getArguments();
|
||||
return ManageApplications.getTitleResId(intent, args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.location.RecentLocationAccessSeeAllFragment;
|
||||
|
||||
/**
|
||||
@@ -43,4 +44,9 @@ public class ProfileSelectRecentLocationAccessFragment extends ProfileSelectFrag
|
||||
workFragment
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.location_recent_location_access_header;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.location.RecentLocationRequestSeeAllFragment;
|
||||
|
||||
/**
|
||||
@@ -43,4 +44,9 @@ public class ProfileSelectRecentLocationRequestFragment extends ProfileSelectFra
|
||||
workFragment
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreferenceScreenResId() {
|
||||
return R.xml.location_recent_requests_header;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user