Search in sources :

Example 81 with GridLayoutManager

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;
}
Also used : GridLayoutManager(androidx.recyclerview.widget.GridLayoutManager) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView)

Example 82 with GridLayoutManager

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;
}
Also used : GridLayoutManager(androidx.recyclerview.widget.GridLayoutManager) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView)

Example 83 with GridLayoutManager

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;
}
Also used : GridLayoutManager(androidx.recyclerview.widget.GridLayoutManager) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView)

Example 84 with GridLayoutManager

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;
}
Also used : GridLayoutManager(androidx.recyclerview.widget.GridLayoutManager) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView)

Example 85 with GridLayoutManager

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;
}
Also used : PerfListener(com.facebook.samples.comparison.instrumentation.PerfListener) GridLayoutManager(androidx.recyclerview.widget.GridLayoutManager) Handler(android.os.Handler) AdapterView(android.widget.AdapterView) View(android.view.View) AdapterView(android.widget.AdapterView) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) Point(android.graphics.Point)

Aggregations

GridLayoutManager (androidx.recyclerview.widget.GridLayoutManager)109 RecyclerView (androidx.recyclerview.widget.RecyclerView)57 View (android.view.View)44 TextView (android.widget.TextView)19 StaggeredGridLayoutManager (androidx.recyclerview.widget.StaggeredGridLayoutManager)14 ImageView (android.widget.ImageView)11 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)11 Toolbar (androidx.appcompat.widget.Toolbar)10 Nullable (androidx.annotation.Nullable)9 SmoothScrollGridLayoutManager (eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager)7 ViewGroup (android.view.ViewGroup)6 SuppressLint (android.annotation.SuppressLint)5 Context (android.content.Context)5 NonNull (androidx.annotation.NonNull)5 ArrayList (java.util.ArrayList)5 RefreshingListenerAdapter (me.dkzwm.widget.srl.RefreshingListenerAdapter)5 List (java.util.List)4 Handler (android.os.Handler)3 FrameLayout (android.widget.FrameLayout)3 SwipeRefreshLayout (androidx.swiperefreshlayout.widget.SwipeRefreshLayout)3