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


Java ListFragment類代碼示例

本文整理匯總了Java中android.support.v4.app.ListFragment的典型用法代碼示例。如果您正苦於以下問題:Java ListFragment類的具體用法?Java ListFragment怎麽用?Java ListFragment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: onCreate

import android.support.v4.app.ListFragment; //導入依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mListFragment = (ListFragment) getSupportFragmentManager().findFragmentById(R.id.list);
    mListFragment.getListView().setOnItemClickListener(this);

    mAddAccountButton = (Button) findViewById(R.id.add_account);
    mAddAccountButton.setOnClickListener(this);

    mLeagueAdapter = new LeagueAdapter();
    mAccountAdapter = new AccountAdapter();

    initAccountManager();

    if (savedInstanceState != null) {
        mShowingAccounts = savedInstanceState.getBoolean(SAVED_SHOWING_ACCOUNTS);
    }

    updateActiveList(false);

    getSupportLoaderManager().initLoader(LOADER_LEAGUE, null, this);
}
 
開發者ID:jpd236,項目名稱:fantasywear,代碼行數:25,代碼來源:MainActivity.java

示例2: viewMostRecentExperiment

import android.support.v4.app.ListFragment; //導入依賴的package包/類
public static Activity viewMostRecentExperiment(ActivityInstrumentationTestCase2<?> testCase,
        Activity activity) {
    // view the most recent experiment
    Fragment fragment = ((SensorDataCollectorActivity) activity).getSupportFragmentManager()
            .findFragmentById(R.id.fragment_container);
    Assert.assertNotNull("The Sensor List Fragment should not be null.", fragment);

    ListView listView = ((ListFragment) fragment).getListView();
    Assert.assertNotNull("ListView should not be null.", listView);

    ActivityMonitor monitor = testCase.getInstrumentation().addMonitor(
            ViewExperimentActivity.class.getName(), null, false);
    TouchUtils.clickView(testCase, listView.getChildAt(listView.getHeaderViewsCount()));
    testCase.getInstrumentation().waitForIdleSync();

    ViewExperimentActivity viewExperimentActivity = (ViewExperimentActivity) testCase
            .getInstrumentation().waitForMonitor(monitor);
    Assert.assertTrue("activity should be a ViewExperimentActivity.",
            viewExperimentActivity instanceof ViewExperimentActivity);
    testCase.getInstrumentation().removeMonitor(monitor);

    // clone the experiment
    testCase.getInstrumentation().waitForIdleSync();
    return viewExperimentActivity;
}
 
開發者ID:sysnetlab,項目名稱:SensorDataCollector,代碼行數:26,代碼來源:TestHelper.java

示例3: onCreateView

import android.support.v4.app.ListFragment; //導入依賴的package包/類
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_list_view,
            container, false);
    mAdapter = new MapAdapter(getActivity(), LIST_OPTION_VIEW);
    mList = (ListFragment) getChildFragmentManager().findFragmentById(R.id.list);
    mList.setListAdapter(mAdapter);
    AbsListView lv = mList.getListView();
    lv.setRecyclerListener(mRecycleListener);
    return view;

}
 
開發者ID:bkhezry,項目名稱:ExtraMapUtils,代碼行數:13,代碼來源:ListViewFragment.java

示例4: type

import android.support.v4.app.ListFragment; //導入依賴的package包/類
public static SubjectFactory<ListFragmentSubject, ListFragment> type() {
  return new SubjectFactory<ListFragmentSubject, ListFragment>() {
    @Override
    public ListFragmentSubject getSubject(FailureStrategy fs, ListFragment that) {
      return new ListFragmentSubject(fs, that);
    }
  };
}
 
開發者ID:pkware,項目名稱:truth-android,代碼行數:9,代碼來源:ListFragmentSubject.java

示例5: onCreate

import android.support.v4.app.ListFragment; //導入依賴的package包/類
@Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ListFragment listFragment = new SimpleListFragment();

    getSupportFragmentManager().beginTransaction().replace(R.id.container, listFragment).commit();
}
 
開發者ID:xu6148152,項目名稱:binea_project_for_android,代碼行數:8,代碼來源:MainActivity.java

示例6: UpdateAdsTask

import android.support.v4.app.ListFragment; //導入依賴的package包/類
public UpdateAdsTask(ListFragment _fragment, Integer _woeid) {
    api = NolotiroAPI.getInstance();
    context = _fragment.getActivity();
    fragment = _fragment;
    woeid = _woeid;
   // progress = new ProgressDialog(context);
   // progress.setMessage(context.getResources().getString(R.string.loading));
}
 
開發者ID:PabloCastellano,項目名稱:nolotiro-android,代碼行數:9,代碼來源:UpdateAdsTask.java

示例7: LoadableDecorator

import android.support.v4.app.ListFragment; //導入依賴的package包/類
public LoadableDecorator(LoaderCallbacks<Result<T>> callbacks, int loaderId,
        ListFragment listFragment) {
    super();
    this.mCallbacks = Preconditions.checkNotNull(callbacks);
    this.mLoaderId = loaderId;
    this.mListFragment = Preconditions.checkNotNull(listFragment);
    this.mAdapterView = Preconditions.checkNotNull(listFragment.getListView());

    mListFragment.setListShown(false);
}
 
開發者ID:wuman,項目名稱:android-oauth-client,代碼行數:11,代碼來源:LoadableDecorator.java

示例8: getItem

import android.support.v4.app.ListFragment; //導入依賴的package包/類
@Override
public Fragment getItem(int position) {
    // if its 1st page, show our nearby UI
    if (position == 0) return new NearbyFragment();
    else return new ListFragment();
}
 
開發者ID:AgmoStudioSdnBhd,項目名稱:Android-Pasar-Malam-Locator,代碼行數:7,代碼來源:MainActivity.java

示例9: getItem

import android.support.v4.app.ListFragment; //導入依賴的package包/類
@Override
public Fragment getItem(int position) {
    // temporarily use existing UI as placeholder
    return new ListFragment();
}
 
開發者ID:AgmoStudioSdnBhd,項目名稱:Android-Pasar-Malam-Locator,代碼行數:6,代碼來源:MainActivity.java

示例10: ListFragmentSubject

import android.support.v4.app.ListFragment; //導入依賴的package包/類
protected ListFragmentSubject(FailureStrategy failureStrategy, ListFragment subject) {
  super(failureStrategy, subject);
}
 
開發者ID:pkware,項目名稱:truth-android,代碼行數:4,代碼來源:ListFragmentSubject.java

示例11: CourseListAdapter

import android.support.v4.app.ListFragment; //導入依賴的package包/類
public CourseListAdapter(ListFragment context, List<Lehrveranstaltung> list) {
	super(context, list, R.layout.course_list_item);
}
 
開發者ID:protyposis,項目名稱:Studentenportal,代碼行數:4,代碼來源:CourseListFragment.java

示例12: GenericListFragmentAdapter

import android.support.v4.app.ListFragment; //導入依賴的package包/類
public GenericListFragmentAdapter(ListFragment context, List<T> list, int viewResourceId) {
	this.mContext = context;
	this.mList = list;
	this.mViewResourceId = viewResourceId;
}
 
開發者ID:protyposis,項目名稱:Studentenportal,代碼行數:6,代碼來源:GenericListFragmentAdapter.java

示例13: ExamListAdapter

import android.support.v4.app.ListFragment; //導入依賴的package包/類
public ExamListAdapter(ListFragment context, List<Pruefung> list) {
	super(context, list, R.layout.exam_list_item);
}
 
開發者ID:protyposis,項目名稱:Studentenportal,代碼行數:4,代碼來源:ExamListFragment.java

示例14: ShunixHandler

import android.support.v4.app.ListFragment; //導入依賴的package包/類
public ShunixHandler(ListFragment fragment) {
	this.fragment = fragment;
}
 
開發者ID:shunix,項目名稱:Ingress-Portals-Navigation,代碼行數:4,代碼來源:ShunixHandler.java

示例15: onCreate

import android.support.v4.app.ListFragment; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	setTheme(PreferenceManager.getDefaultSharedPreferences(this).getBoolean(getString(R.string.pref_night_mode_key), false) ? R.style.AppBaseTheme : R.style.AppBaseTheme_Light);
	setContentView(R.layout.activity_diagnostics);
	
	protocolversion = SettingsActivity.getProtocolVersion(this);
	List<Fragment> pages = new ArrayList<>();
	ArrayList<BaseParamItem> inputItems = new ArrayList<>();
	outputItems = new ArrayList<>();
	
	inputItems.add(new ParamItemFloat(this, R.string.diag_input_voltage_title, 0, R.string.units_volts,0,0,100,0).setFormat("%.3f"));
	inputItems.add(new ParamItemFloat(this, R.string.diag_input_map_s, 0, R.string.units_volts,0,0,100,0).setFormat("%.3f"));
	inputItems.add(new ParamItemFloat(this, R.string.diag_input_temp, 0, R.string.units_volts,0,0,100,0).setFormat("%.3f"));
	inputItems.add(new ParamItemFloat(this, R.string.diag_input_add_io1, 0, R.string.units_volts,0,0,100,0).setFormat("%.3f"));
	inputItems.add(new ParamItemFloat(this, R.string.diag_input_add_io2, 0, R.string.units_volts,0,0,100,0).setFormat("%.3f"));
	inputItems.add(new ParamItemFloat(this, R.string.diag_input_carb_title, 0, R.string.units_volts,0,0,100,0).setFormat("%.3f"));
	inputItems.add(new ParamItemBoolean(this, R.string.diag_input_gas_v, 0, false,false));
	inputItems.add(new ParamItemBoolean(this, R.string.diag_input_ckps, 0, false,false));
	inputItems.add(new ParamItemBoolean(this, R.string.diag_input_ref_s, 0, false,false));
	inputItems.add(new ParamItemBoolean(this, R.string.diag_input_ps, 0, false,false));
	inputItems.add(new ParamItemBoolean(this, R.string.diag_input_bl, 0, false,false));
	inputItems.add(new ParamItemBoolean(this, R.string.diag_input_de, 0, false,false));
	inputItems.add(new ParamItemFloat(this, R.string.diag_input_ks1_title, 0, R.string.units_volts,0,0,100,0).setFormat("%.3f"));
	inputItems.add(new ParamItemFloat(this, R.string.diag_input_ks2_title, 0, R.string.units_volts,0,0,100,0).setFormat("%.3f"));

	createOutputs();
	
	inputFragment = new ListFragment();
	inputFragment.setListAdapter(new ParamItemsAdapter(inputItems));
	OutputDiagListFragment outputsFragment = new OutputDiagListFragment();
	outputsFragment.setOnItemClickListener(this);
	outputsFragment.setListAdapter(new ParamItemsAdapter(outputItems));
	pages.add(inputFragment);
	pages.add(outputsFragment);

	DiagnosticsPagerAdapter diagnosticsAdapter = new DiagnosticsPagerAdapter(getSupportFragmentManager(),pages);
	receiver = new ReceiveMessages();
	textViewStatus = (TextView) findViewById(R.id.diagnosticsStatusTextView);		
	pager = (ViewPager)findViewById(R.id.diagnosticsPager);
	pager.setAdapter(diagnosticsAdapter);	
	
	if (savedInstanceState != null) {
		int outputs = savedInstanceState.getInt(OUTPUTS);
		setOutputs(outputs);
		boolean blde = savedInstanceState.getBoolean(BLDEENABLED);
		setBlDeEnabled(blde);
		int page = savedInstanceState.getInt(PAGE);
		pager.setCurrentItem(page);
	}
	
	CheckBox checkBoxEnableBlDeDiagnostics = (CheckBox) findViewById(R.id.diagnosticsEnableBlDe);
	checkBoxEnableBlDeDiagnostics.setVisibility((protocolversion >= SettingsActivity.PROTOCOL_14012014_WINTER_RELEASE)?View.VISIBLE:View.GONE);
	checkBoxEnableBlDeDiagnostics.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
		
		@Override
		public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {				
			setBlDeEnabled(isChecked);
		}
	});
	
	super.onCreate(savedInstanceState);		
}
 
開發者ID:mmlevin,項目名稱:secu3droid,代碼行數:63,代碼來源:DiagnosticsActivity.java


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