-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAboutFragment.java
More file actions
48 lines (41 loc) · 1.66 KB
/
AboutFragment.java
File metadata and controls
48 lines (41 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.Go.GoCart;
import android.graphics.Color;
import android.os.Bundle;
import android.preference.PreferenceFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
public class AboutFragment extends PreferenceFragment {
private ViewGroup parent;
View currView;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.about_preferences);
}
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = super.onCreateView(inflater, container, savedInstanceState);
if (view != null) {
ListView listView = view.findViewById(android.R.id.list);
if (listView != null) {
listView.setCacheColorHint(Color.TRANSPARENT);
listView.setFocusableInTouchMode(true);
listView.setSelector(getResources().getDrawable(R.drawable.transparent_drawable));
}
}
parent = container;
currView = view;
view.setBackgroundColor(ContextCompat.getColor(parent.getContext(), R.color.colorPrimary));
return view;
}
@Override
public void onResume() {
super.onResume();
parent.getContext().setTheme(R.style.PreferenceTheme);
currView.setBackgroundColor(ContextCompat.getColor(parent.getContext(), R.color.cpWhite));
}
}