Search in sources :

Example 61 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project Carbon by ZieIony.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Samples.initToolbar(this, getString(R.string.app_name));
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
    ViewModel[] items = new ViewModel[] { new ViewModel(AnimationsActivity.class, getString(R.string.animationsActivity_title)), new ViewModel(AppsLibrariesActivity.class, getString(R.string.appsLibrariesActivity_title)), new ViewModel(ColorsActivity.class, getString(R.string.colorsActivity_title)), new ViewModel(ComponentsActivity.class, getString(R.string.componentsActivity_title)), new ViewModel(DemosActivity.class, getString(R.string.demosActivity_title)), new ViewModel(FeaturesActivity.class, getString(R.string.featuresActivity_title)), new ViewModel(GuidelinesActivity.class, getString(R.string.guidelinesActivity_title)), new ViewModel(WidgetsActivity.class, getString(R.string.widgetsActivity_title)) };
    recyclerView.setLayoutManager(getResources().getBoolean(R.bool.tablet) ? new GridLayoutManager(this, 2, LinearLayoutManager.VERTICAL, false) : new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
    recyclerView.setAdapter(new MainListAdapter(items));
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) RecyclerView(carbon.widget.RecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 62 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project AndroidPhotoFilters by Zomato.

the class MainActivity method initHorizontalList.

private void initHorizontalList() {
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
    layoutManager.scrollToPosition(0);
    thumbListView.setLayoutManager(layoutManager);
    thumbListView.setHasFixedSize(true);
    bindDataToAdapter();
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 63 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project remusic by aa112901.

the class DownMusicFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.down_music_recylerview, container, false);
    layoutManager = new LinearLayoutManager(mContext);
    recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(layoutManager);
    folderDetailAdapter = new FolderDetailAdapter(null);
    recyclerView.setAdapter(folderDetailAdapter);
    recyclerView.setHasFixedSize(true);
    setItemDecoration();
    reloadAdapter();
    return view;
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TintImageView(com.bilibili.magicasakura.widgets.TintImageView) TextView(android.widget.TextView) View(android.view.View)

Example 64 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project remusic by aa112901.

the class FolderDetailFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_common, container, false);
    layoutManager = new LinearLayoutManager(mContext);
    recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    recyclerView.setLayoutManager(layoutManager);
    folderDetailAdapter = new FolderDetailAdapter(null);
    recyclerView.setAdapter(folderDetailAdapter);
    setItemDecoration();
    reloadAdapter();
    recyclerView.setHasFixedSize(true);
    toolbar = (Toolbar) view.findViewById(R.id.toolbar);
    ((AppCompatActivity) mContext).setSupportActionBar(toolbar);
    toolbar.setPadding(0, CommonUtils.getStatusHeight(mContext), 0, 0);
    ab = ((AppCompatActivity) mContext).getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.actionbar_back);
    ab.setDisplayHomeAsUpEnabled(true);
    String folder = folder_path.substring(folder_path.lastIndexOf(File.separator), folder_path.length());
    ab.setTitle(folder.substring(folder.lastIndexOf(File.separator) + 1, folder.length()));
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mContext.onBackPressed();
        }
    });
    return view;
}
Also used : AppCompatActivity(android.support.v7.app.AppCompatActivity) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) TintImageView(com.bilibili.magicasakura.widgets.TintImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView)

Example 65 with LinearLayoutManager

use of android.support.v7.widget.LinearLayoutManager in project remusic by aa112901.

the class FolderFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.recylerview, container, false);
    // folderInfos = MusicUtils.queryFolder(mContext);
    recyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);
    layoutManager = new LinearLayoutManager(mContext);
    recyclerView.setLayoutManager(layoutManager);
    mAdapter = new Adapter(null);
    recyclerView.setAdapter(mAdapter);
    recyclerView.setHasFixedSize(true);
    setItemDecoration();
    isAZSort = mPreferences.getFoloerSortOrder().equals(SortOrder.FolderSortOrder.FOLDER_A_Z);
    dialogText = (TextView) view.findViewById(R.id.dialog_text);
    sideBar = (SideBar) view.findViewById(R.id.sidebar);
    sideBar.setOnTouchingLetterChangedListener(new SideBar.OnTouchingLetterChangedListener() {

        @Override
        public void onTouchingLetterChanged(String s) {
            dialogText.setText(s);
            sideBar.setView(dialogText);
            Log.e("scrol", "  " + s);
            if (positionMap.get(s) != null) {
                int i = positionMap.get(s);
                Log.e("scrolget", "  " + i);
                ((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(i, 0);
            }
        }
    });
    reloadAdapter();
    return view;
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) TintImageView(com.bilibili.magicasakura.widgets.TintImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) SideBar(com.wm.remusic.widget.SideBar)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1976 RecyclerView (android.support.v7.widget.RecyclerView)1085 View (android.view.View)822 TextView (android.widget.TextView)352 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)235 ArrayList (java.util.ArrayList)204 ImageView (android.widget.ImageView)186 Intent (android.content.Intent)150 Toolbar (android.support.v7.widget.Toolbar)134 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)131 GridLayoutManager (android.support.v7.widget.GridLayoutManager)125 BindView (butterknife.BindView)124 Bundle (android.os.Bundle)109 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)105 Nullable (android.support.annotation.Nullable)98 ViewGroup (android.view.ViewGroup)82 Context (android.content.Context)81 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)80 AdapterView (android.widget.AdapterView)70 List (java.util.List)69