use of androidx.recyclerview.widget.GridLayoutManager in project android_packages_apps_crDroidSettings by crdroidandroid.
the class FontsPicker method onCreateView.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.item_view, container, false);
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 1);
mRecyclerView.setLayoutManager(gridLayoutManager);
Adapter mAdapter = new Adapter(getActivity());
mRecyclerView.setAdapter(mAdapter);
return view;
}
use of androidx.recyclerview.widget.GridLayoutManager in project android_packages_apps_crDroidSettings by crdroidandroid.
the class IconShapes method onCreateView.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.item_view, container, false);
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 3);
mRecyclerView.setLayoutManager(gridLayoutManager);
Adapter mAdapter = new Adapter(getActivity());
mRecyclerView.setAdapter(mAdapter);
return view;
}
use of androidx.recyclerview.widget.GridLayoutManager in project android_packages_apps_crDroidSettings by crdroidandroid.
the class NavbarStyles method onCreateView.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.item_view, container, false);
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 2);
mRecyclerView.setLayoutManager(gridLayoutManager);
Adapter mAdapter = new Adapter(getActivity());
mRecyclerView.setAdapter(mAdapter);
return view;
}
use of androidx.recyclerview.widget.GridLayoutManager in project android_packages_apps_crDroidSettings by crdroidandroid.
the class SignalIcons method onCreateView.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.item_view, container, false);
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 3);
mRecyclerView.setLayoutManager(gridLayoutManager);
Adapter mAdapter = new Adapter(getActivity());
mRecyclerView.setAdapter(mAdapter);
return view;
}
use of androidx.recyclerview.widget.GridLayoutManager in project fresco by facebook.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mRecyclerView = (RecyclerView) findViewById(R.id.image_grid);
mRecyclerView.setLayoutManager(new GridLayoutManager(this, COLS_NUMBER));
FLog.setMinimumLoggingLevel(FLog.WARN);
Drawables.init(getResources());
mPerfListener = new PerfListener();
mAllowAnimations = true;
mCurrentLoaderAdapterIndex = 0;
mCurrentSourceAdapterIndex = 0;
if (savedInstanceState != null) {
mAllowAnimations = savedInstanceState.getBoolean(EXTRA_ALLOW_ANIMATIONS);
mCurrentLoaderAdapterIndex = savedInstanceState.getInt(EXTRA_CURRENT_ADAPTER_INDEX);
mCurrentSourceAdapterIndex = savedInstanceState.getInt(EXTRA_CURRENT_SOURCE_ADAPTER_INDEX);
}
mHandler = new Handler(Looper.getMainLooper());
mStatsClockTickRunnable = new Runnable() {
@Override
public void run() {
updateStats();
scheduleNextStatsClockTick();
}
};
mCurrentAdapter = null;
mStatsDisplay = (TextView) findViewById(R.id.stats_display);
mLoaderSelect = (Spinner) findViewById(R.id.loader_select);
mLoaderSelect.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
setLoaderAdapter(position);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
mLoaderSelect.setSelection(mCurrentLoaderAdapterIndex);
mSourceSelect = (Spinner) findViewById(R.id.source_select);
mSourceSelect.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
setSourceAdapter(position);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
mSourceSelect.setSelection(mCurrentSourceAdapterIndex);
mHasStoragePermissions = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
}
Aggregations