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


Java ListView.setVerticalScrollBarEnabled方法代碼示例

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


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

示例1: onActivityCreated

import android.widget.ListView; //導入方法依賴的package包/類
@Override 
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    ListView lv = getListView();

    //getListView().setSelector(R.drawable.transparent);
    lv.setCacheColorHint(Color.TRANSPARENT);
    
    
    // View management
    View detailsFrame = getActivity().findViewById(R.id.details);
    dualPane = detailsFrame != null && detailsFrame.getVisibility() == View.VISIBLE;
    

    if (savedInstanceState != null) {
        // Restore last state for checked position.
        curCheckFilterId = savedInstanceState.getLong(CURRENT_CHOICE, SipProfile.INVALID_ID);
        //curCheckWizard = savedInstanceState.getString(CURRENT_WIZARD);
    }
    setListShown(false);
    if(mAdapter == null) {
        if(mHeaderView != null) {
            lv.addHeaderView(mHeaderView , null, true);
        }
        mAdapter = new AccountFiltersListAdapter(getActivity(), null);
        //getListView().setEmptyView(getActivity().findViewById(R.id.progress_container));
        //getActivity().findViewById(android.R.id.empty).setVisibility(View.GONE);
        setListAdapter(mAdapter);
        registerForContextMenu(lv);

        
        lv.setVerticalFadingEdgeEnabled(true);
    }
    
    if (dualPane) {
        // In dual-pane mode, the list view highlights the selected item.
    	Log.d("lp", "dual pane mode");
        lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    	//lv.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_LEFT);
        lv.setVerticalScrollBarEnabled(false);
        lv.setFadingEdgeLength(50);
        
        updateCheckedItem();
        // Make sure our UI is in the correct state.
        //showDetails(curCheckPosition, curCheckWizard);
    }else {
    	//getListView().setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_RIGHT);
    	lv.setVerticalScrollBarEnabled(true);
    	lv.setFadingEdgeLength(100);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:52,代碼來源:AccountFiltersListFragment.java

示例2: SlideMenuView

import android.widget.ListView; //導入方法依賴的package包/類
public SlideMenuView(Context context) {
    super(context);
    
    mListView = new ListView(context);
    mListView.setCacheColorHint(0);
    mListView.setDividerHeight(0);
    mListView.setDivider(new ColorDrawable(Color.TRANSPARENT));
    mListView.setVerticalScrollBarEnabled(false);
    mListView.setOnItemClickListener(mListItemClickListener);
    addView(mListView);
}
 
開發者ID:suomenriistakeskus,項目名稱:oma-riista-android,代碼行數:12,代碼來源:SlideMenu.java

示例3: init

import android.widget.ListView; //導入方法依賴的package包/類
private void init() {
    mDialogUtil = new DialogUtil(this);
    TextView title = (TextView) findViewById(R.id.title_layout_titleText);
    title.setText(getResources().getString(R.string.title));
    findViewById(R.id.title_layout_returnRel).setVisibility(View.GONE);
    Button enterBtn = (Button) findViewById(R.id.landmark_enterBtn);
    enterBtn.setText(getResources().getString(R.string.detect_face));
    enterBtn.setOnClickListener(this);
    mInflater = LayoutInflater.from(this);
    findViewById(R.id.activity_rootRel).setOnClickListener(this);
    mListRel = (RelativeLayout) findViewById(R.id.landmark_listRel);
    mListRel.setOnClickListener(this);
    mListView = (ListView) findViewById(R.id.landmark_list);
    mListView.setVerticalScrollBarEnabled(false);

    mListAdapter = new ListAdapter();
    mListView.setAdapter(mListAdapter);
    RelativeLayout rel0 = (RelativeLayout) findViewById(R.id.landmark_imageitem_0);
    RelativeLayout rel1 = (RelativeLayout) findViewById(R.id.landmark_imageitem_1);
    RelativeLayout rel2 = (RelativeLayout) findViewById(R.id.landmark_imageitem_2);
    RelativeLayout rel3 = (RelativeLayout) findViewById(R.id.landmark_imageitem_3);
    RelativeLayout rel4 = (RelativeLayout) findViewById(R.id.landmark_imageitem_4);
    RelativeLayout rel5 = (RelativeLayout) findViewById(R.id.landmark_imageitem_5);
    RelativeLayout rel6 = (RelativeLayout) findViewById(R.id.landmark_imageitem_6);
    RelativeLayout rel7 = (RelativeLayout) findViewById(R.id.landmark_imageitem_7);
    imageItem_Rels = new RelativeLayout[]{rel0, rel1, rel2, rel3, rel4, rel5, rel6, rel7};
    RelativeLayout textRel0 = (RelativeLayout) findViewById(R.id.landmark_edititem_0);
    RelativeLayout textRel1 = (RelativeLayout) findViewById(R.id.landmark_edititem_1);
    RelativeLayout textRel2 = (RelativeLayout) findViewById(R.id.landmark_edititem_2);
    RelativeLayout textRel3 = (RelativeLayout) findViewById(R.id.landmark_edititem_3);
    RelativeLayout textRel4 = (RelativeLayout) findViewById(R.id.landmark_edititem_4);
    textItem_Rels = new RelativeLayout[]{textRel0, textRel1, textRel2, textRel3, textRel4};
}
 
開發者ID:FacePlusPlus,項目名稱:MegviiFacepp-Android-SDK,代碼行數:34,代碼來源:FaceppActionActivity.java

示例4: create

import android.widget.ListView; //導入方法依賴的package包/類
public void create(int width, int maxHeight, AdapterView.OnItemClickListener onItemClickListener) {
    ListView listView = new QMUIWrapContentListView(mContext, maxHeight);
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(width, maxHeight);
    listView.setLayoutParams(lp);
    listView.setAdapter(mAdapter);
    listView.setVerticalScrollBarEnabled(false);
    listView.setOnItemClickListener(onItemClickListener);
    listView.setDivider(null);
    setContentView(listView);
}
 
開發者ID:QMUI,項目名稱:QMUI_Android,代碼行數:11,代碼來源:QMUIListPopup.java

示例5: onCreateView

import android.widget.ListView; //導入方法依賴的package包/類
@Override
public View onCreateView() {
    LinearLayout ll_container = new LinearLayout(context);
    ll_container.setOrientation(LinearLayout.VERTICAL);

    /** title */
    tv_title = new TextView(context);
    tv_title.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.WRAP_CONTENT));
    tv_title.setSingleLine(true);
    tv_title.setPadding(dp2px(18), dp2px(10), 0, dp2px(10));

    ll_container.addView(tv_title);

    /** listview */
    lv = new ListView(context);
    lv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.WRAP_CONTENT));
    lv.setCacheColorHint(Color.TRANSPARENT);
    lv.setFadingEdgeLength(0);
    lv.setVerticalScrollBarEnabled(false);
    lv.setSelector(new ColorDrawable(Color.TRANSPARENT));

    ll_container.addView(lv);

    return ll_container;
}
 
開發者ID:Luodian,項目名稱:Shared-Route,代碼行數:28,代碼來源:NormalListDialog.java

示例6: onActivityCreated

import android.widget.ListView; //導入方法依賴的package包/類
@Override 
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    ListView lv = getListView();

    //getListView().setSelector(R.drawable.transparent);
    lv.setCacheColorHint(Color.TRANSPARENT);
    
    
    // View management
    View detailsFrame = getActivity().findViewById(R.id.details);
    dualPane = detailsFrame != null && detailsFrame.getVisibility() == View.VISIBLE;
    

    if (savedInstanceState != null) {
        // Restore last state for checked position.
        curCheckPosition = savedInstanceState.getLong(CURRENT_CHOICE, SipProfile.INVALID_ID);
        //curCheckWizard = savedInstanceState.getString(CURRENT_WIZARD);
    }
    setListShown(false);
    if(mAdapter == null) {
        if(mHeaderView != null) {
            lv.addHeaderView(mHeaderView , null, true);
        }
        mAdapter = new AccountsEditListAdapter(getActivity(), null);
        mAdapter.setOnCheckedRowListener(this);
        //getListView().setEmptyView(getActivity().findViewById(R.id.progress_container));
        //getActivity().findViewById(android.R.id.empty).setVisibility(View.GONE);
        setListAdapter(mAdapter);
        registerForContextMenu(lv);

        // Prepare the loader.  Either re-connect with an existing one,
        // or start a new one.
        getLoaderManager().initLoader(0, null, this);
        
        lv.setVerticalFadingEdgeEnabled(true);
    }
    
    if (dualPane) {
        // In dual-pane mode, the list view highlights the selected item.
    	Log.d("lp", "dual pane mode");
        lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    	//lv.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_LEFT);
        lv.setVerticalScrollBarEnabled(false);
        lv.setFadingEdgeLength(50);
        
        updateCheckedItem();
        // Make sure our UI is in the correct state.
        //showDetails(curCheckPosition, curCheckWizard);
    }else {
    	//getListView().setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_RIGHT);
    	lv.setVerticalScrollBarEnabled(true);
    	lv.setFadingEdgeLength(100);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:56,代碼來源:AccountsEditListFragment.java

示例7: createView

import android.widget.ListView; //導入方法依賴的package包/類
@Override
public View createView(final Context context) {
    actionBar.setBackgroundColor(Theme.ACTION_BAR_MEDIA_PICKER_COLOR);
    actionBar.setItemsBackgroundColor(Theme.ACTION_BAR_PICKER_SELECTOR_COLOR);
    actionBar.setBackButtonImage(R.drawable.ic_ab_back);
    actionBar.setAllowOverlayTitle(true);
    actionBar.setTitle(LocaleController.getString("FontChange", R.string.FontChange));
    actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
        @Override
        public void onItemClick(int id) {
            if (id == -1) {
                finishFragment();
            }
        }
    });


    fragmentView = new FrameLayout(context);
    fragmentView.setLayoutParams(new FrameLayout.LayoutParams(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));


    FrameLayout frameLayout = (FrameLayout) fragmentView;


    listView = new ListView(context);

    SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff));
    listView.setDivider(null);
    listView.setDividerHeight(0);
    listView.setVerticalScrollBarEnabled(false);
    int def = preferences.getInt("themeColor", AndroidUtilities.defColor);
    int hColor = preferences.getInt("prefHeaderColor", def);
    AndroidUtilities.setListViewEdgeEffectColor(listView, /*AvatarDrawable.getProfileBackColorForId(5)*/ hColor);
    frameLayout.addView(listView);
    FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) listView.getLayoutParams();
    layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT;
    layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT;
    layoutParams.gravity = Gravity.TOP;
    listView.setLayoutParams(layoutParams);

    initFonts(context);



    return fragmentView;
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:48,代碼來源:FontsSelect.java

示例8: createView

import android.widget.ListView; //導入方法依賴的package包/類
@Override
public View createView(final Context context) {
    actionBar.setBackgroundColor(Theme.ACTION_BAR_MEDIA_PICKER_COLOR);
    actionBar.setItemsBackgroundColor(Theme.ACTION_BAR_PICKER_SELECTOR_COLOR);
    actionBar.setBackButtonImage(R.drawable.ic_ab_back);
    actionBar.setAllowOverlayTitle(true);
    actionBar.setTitle(LocaleController.getString("ThemeStore", R.string.ThemeStore));
    actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
        @Override
        public void onItemClick(int id) {
            if (id == -1) {
                finishFragment();
            }
        }
    });


    fragmentView = new FrameLayout(context);
    fragmentView.setLayoutParams(new FrameLayout.LayoutParams(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));


    FrameLayout frameLayout = (FrameLayout) fragmentView;


    listView = new ListView(context);

    SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences(AndroidUtilities.THEME_PREFS, AndroidUtilities.THEME_PREFS_MODE);
    listView.setBackgroundColor(preferences.getInt("prefBGColor", 0xffffffff));
    listView.setDivider(null);
    listView.setDividerHeight(0);
    listView.setVerticalScrollBarEnabled(false);
    int def = preferences.getInt("themeColor", AndroidUtilities.defColor);
    int hColor = preferences.getInt("prefHeaderColor", def);
    AndroidUtilities.setListViewEdgeEffectColor(listView, /*AvatarDrawable.getProfileBackColorForId(5)*/ hColor);
    frameLayout.addView(listView);
    FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) listView.getLayoutParams();
    layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT;
    layoutParams.height = FrameLayout.LayoutParams.MATCH_PARENT;
    layoutParams.gravity = Gravity.TOP;
    listView.setLayoutParams(layoutParams);

    progressDialog = new ProgressDialog(context);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.setMessage(context.getString(R.string.Loading));

    if (Cashing.themes.size() < 1) {
        progressDialog.show();
        new getThemes(context, constant.GET_THEMES).execute();
    } else {
        themes = Cashing.themes;
        refreshDisplay(context);
    }

    return fragmentView;
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:56,代碼來源:ThemStore.java


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