當前位置: 首頁>>代碼示例>>Java>>正文


Java RecyclerView.setFocusable方法代碼示例

本文整理匯總了Java中android.support.v7.widget.RecyclerView.setFocusable方法的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerView.setFocusable方法的具體用法?Java RecyclerView.setFocusable怎麽用?Java RecyclerView.setFocusable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v7.widget.RecyclerView的用法示例。


在下文中一共展示了RecyclerView.setFocusable方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreateView

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Log.d(TAG, "onCreateView");
    View v = inflater.inflate(R.layout.samba_discovery_fragment, container, false);

    mDiscoveryList = (RecyclerView)v.findViewById(R.id.discovery_list);
    mLayoutManager = new LinearLayoutManager(getActivity());
    mDiscoveryList.setLayoutManager(mLayoutManager);
    mDiscoveryList.setHasFixedSize(false); // there are separators
    mDiscoveryList.setAdapter(mAdapter);
    mDiscoveryList.setFocusable(false);
    if (savedInstanceState!=null) {
        mAdapter.onRestoreInstanceState(savedInstanceState); // Restore the adapter "saved instance" parameters
        mLayoutManager.onRestoreInstanceState(savedInstanceState.getParcelable("mLayoutManager")); // Restore the layout manager state
    }

    loadIndexedShortcuts();
    return v;
}
 
開發者ID:archos-sa,項目名稱:aos-Video,代碼行數:20,代碼來源:NewRootFragment.java

示例2: onViewCreated

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    final RecyclerView listView = getListView();

    // We don't want this. The children are still focusable.
    listView.setFocusable(false);
}
 
開發者ID:djuelg,項目名稱:Neuronizer,代碼行數:9,代碼來源:SettingsFragment.java

示例3: renderMenuListView

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void renderMenuListView(View view) {
    RecyclerView listView = (RecyclerView) view.findViewById(R.id.recycler_view);
    PictureChooserMenuAdapter adapter =
          new PictureChooserMenuAdapter(getActivity().getLayoutInflater(), this::handleClickItem);
    adapter.addLastCollection(mMenuList);
    final LinearLayoutManager llm = new LinearLayoutManager(view.getContext());
    llm.setOrientation(LinearLayoutManager.VERTICAL);
    listView.setLayoutManager(llm);
    listView.setAdapter(adapter);
    listView.setHasFixedSize(true);
    listView.setFocusable(false);
}
 
開發者ID:allsoft777,項目名稱:SimpleAvatarPicker,代碼行數:14,代碼來源:PictureChooserDialog.java

示例4: onViewCreated

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    final RecyclerView listView = getListView();

    // We're using alternative divider.
    listView.addItemDecoration(new PreferenceDividerDecoration(getContext()).drawBottom(true).drawBetweenCategories(true));
    setDivider(null);

    // We don't want this. The children are still focusable.
    listView.setFocusable(false);
}
 
開發者ID:fekracomputers,項目名稱:IslamicLibraryAndroid,代碼行數:13,代碼來源:SettingsFragment.java

示例5: onViewCreated

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    // this solves the "preference screen background is a darker gray" problem:
    // https://github.com/consp1racy/android-support-preference/issues/22
    super.onViewCreated(view, savedInstanceState);

    final RecyclerView listView = getListView();

    // We don't want this. The children are still focusable.
    listView.setFocusable(false);
}
 
開發者ID:gbl08ma,項目名稱:underlx,代碼行數:12,代碼來源:GeneralPreferenceFragment.java

示例6: handleShareWithBottomSheets

import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
private void handleShareWithBottomSheets(@NonNull final Activity activity, @NonNull
        BottomSheetDialog
        shareDialog, @NonNull final Intent shareIntent) {
    List<ActionMenuItem> menus = new ArrayList<>();
    shareDialog.setCanceledOnTouchOutside(false);
    RecyclerView gridView = ((RecyclerView) shareDialog.findViewById(R.id.recyclerView));
    if (gridView == null) {
        throw new NullPointerException("you should declare a id named recyclerView in your " +
                "bottomSheets layout!");
    }
    int grid = 4;
    gridView.setLayoutManager(new GridLayoutManager(activity, grid));
    gridView.setNestedScrollingEnabled(false);
    gridView.setFocusable(false);
    gridView.setHasFixedSize(true);
    int v = DisplayUtil.dp2px(activity, 3);
    int h = DisplayUtil.dp2px(activity, 8);
    SpaceGridItemDecoration spaceItemDecoration = new SpaceGridItemDecoration(grid, h, v,
            h, v);
    ShareGridAdapter gridAdapter = new ShareGridAdapter();
    gridView.setAdapter(gridAdapter);
    gridView.addItemDecoration(spaceItemDecoration);


    PackageManager pm = activity.getPackageManager();
    final List<ResolveInfo> list = pm.queryIntentActivities(shareIntent, 0);
    for (int i = 0; i < list.size(); i++) {
        ActionMenuItem item = new ActionMenuItem(activity, 0, i, 0, 0, list.get(i).loadLabel
                (pm));
        item.setIcon(list.get(i).loadIcon(pm));
        menus.add(item);
    }

    gridAdapter.setClickListener(new OnSampleClickListener<ActionMenuItem>() {
        @Override
        public void onClick(View view, ActionMenuItem obj) {
            ActivityInfo activityInfo = list.get(obj.getItemId()).activityInfo;
            ComponentName name = new ComponentName(activityInfo.applicationInfo.packageName,
                    activityInfo.name);
            shareIntent.setComponent(name);
            activity.startActivity(shareIntent);
        }
    });
    gridAdapter.setMenuItems(menus);
    gridAdapter.notifyDataSetChanged();
    shareDialog.show();
}
 
開發者ID:didikee,項目名稱:CommonDependence,代碼行數:48,代碼來源:AndroidShareHelper.java


注:本文中的android.support.v7.widget.RecyclerView.setFocusable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。