当前位置: 首页>>代码示例>>Java>>正文


Java ListView.setEnabled方法代码示例

本文整理汇总了Java中android.widget.ListView.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ListView.setEnabled方法的具体用法?Java ListView.setEnabled怎么用?Java ListView.setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ListView的用法示例。


在下文中一共展示了ListView.setEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUIBusy

import android.widget.ListView; //导入方法依赖的package包/类
private void setUIBusy(Boolean busy) {
    mUIBusy = busy;

    ListView listView = (ListView) findViewById(R.id.listView);
    ProgressBar pbBusy = (ProgressBar) findViewById(R.id.pbBusy);

    listView.setEnabled(!busy);

    if (busy) {
        pbBusy.setVisibility(View.VISIBLE);
    } else {
        pbBusy.setVisibility(View.INVISIBLE);
    }
}
 
开发者ID:njitdev,项目名称:sa-android,代码行数:15,代码来源:HomeActivity.java

示例2: onCreateView

import android.widget.ListView; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {

    mPlaylist = "queue";


    RelativeLayout main = (RelativeLayout) inflater.inflate(
            R.layout.media_picker_activity_playlist, container, false);

    activity = getActivity();
    mTxt = (TextView) main.findViewById(R.id.nointernet);
    listView = (ListView) main.findViewById(android.R.id.list);
    listView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                                long arg3) {

            if (!isNetworkAvailable(getActivity())) {
                listView.setEnabled(false);
                mTxt.setVisibility(View.VISIBLE);
            } else
                MusicUtils.execute(false, new clickerTask(arg2), true);

        }
    });
    if (!isNetworkAvailable(activity)) {
        listView.setEnabled(false);
        mTxt.setVisibility(View.VISIBLE);
    }

    ((TouchInterceptor) listView).setDropListener(mDropListener);
    ((TouchInterceptor) listView).setRemoveListener(mRemoveListener);

    IntentFilter f = new IntentFilter();
    f.addAction(MediaPlaybackService.META_CHANGED);
    f.addAction(MediaPlaybackService.QUEUE_CHANGED);
    activity.registerReceiver(mNowPlayingListener, new IntentFilter(f));
    mNowPlayingListener.onReceive(activity, new Intent(
            MediaPlaybackService.META_CHANGED));
    mToken = MusicUtils.bindToService(activity, this);

    return main;
}
 
开发者ID:89luca89,项目名称:ThunderMusic,代码行数:45,代码来源:NowplayingOnlineFragment.java

示例3: onCreate

import android.widget.ListView; //导入方法依赖的package包/类
/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    PreferenceManager.getDefaultSharedPreferences(this)
            .registerOnSharedPreferenceChangeListener(this);
    Intent intent = getIntent();
    if (savedInstanceState != null) {
        mPlaylist = savedInstanceState.getString("playlist");
        called = savedInstanceState.getBoolean("called");
        mCenter = savedInstanceState.getBoolean("center");
    } else {
        mPlaylist = intent.getStringExtra("playlist");
        called = intent.getBooleanExtra("called", true);
        mCenter = intent.getBooleanExtra("center", false);
    }

    getWindow().setUiOptions(
            ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);
    if (!called)
        ThemeUtils.getAppTheme(this);
    setVolumeControlStream(AudioManager.STREAM_MUSIC);
    super.onCreate(savedInstanceState);

    setContentView(R.layout.media_picker_activity_playlist);
    if (!called) {
        getActionBar().setDisplayHomeAsUpEnabled(false);
        getActionBar().setDisplayShowHomeEnabled(true);
        getActionBar().setHomeButtonEnabled(true);
        // Initialize part of the UI only if we are not in the
        // Nowplaying activity
        if (!mPlaylist.equalsIgnoreCase("queue")) {
            getActionBar().setTitle(mPlaylist);

            InterfaceUtils.setUpFAB(this,
                    R.drawable.music_playall_holo_dark, (FloatingActionButton) findViewById(R.id.FAB), mFABlistener);
        } else
            getActionBar().setTitle(R.string.nowplaying_title);

    }

    activity = this;
    mTxt = (TextView) findViewById(R.id.nointernet);
    listView = (ListView) findViewById(android.R.id.list);
    listView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                                long arg3) {

            if (!isNetworkAvailable(getBaseContext())) {
                listView.setEnabled(false);
                mTxt.setVisibility(View.VISIBLE);
            } else
                MusicUtils.execute(false, new clickerTask(arg2), true);

        }
    });
    if (!isNetworkAvailable(this)) {
        listView.setEnabled(false);
        mTxt.setVisibility(View.VISIBLE);
    }

    if (!called)
        ((TouchInterceptor) listView).setDropListener(mDropListener);
    ((TouchInterceptor) listView).setRemoveListener(mRemoveListener);

    IntentFilter f = new IntentFilter();
    f.addAction(MediaPlaybackService.META_CHANGED);
    f.addAction(MediaPlaybackService.QUEUE_CHANGED);
    registerReceiver(mNowPlayingListener, new IntentFilter(f));
    mNowPlayingListener.onReceive(this, new Intent(
            MediaPlaybackService.META_CHANGED));
    mToken = MusicUtils.bindToService(this, this);

}
 
开发者ID:89luca89,项目名称:ThunderMusic,代码行数:77,代码来源:TrackOnlinePlaylistBrowser.java


注:本文中的android.widget.ListView.setEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。