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


Java PullToRefreshAttacher.get方法代码示例

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


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

示例1: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	
	homeReceiver = new HomeReceiver();
	IntentFilter intentFilter = new IntentFilter("cn.edu.njupt.allgo.HomeACTIVITY");  
	registerReceiver(homeReceiver, intentFilter);
	
	Intent intent = new Intent(this,PullService.class);
	intent.putExtra("action", 1);
	startService(intent);
	
	setContentView(R.layout.activity_home);
	mPullToRefreshAttacher = PullToRefreshAttacher.get(this);
	findViewById(savedInstanceState);
	initView(); 
	if(savedInstanceState == null) {
		selectItem(1);
	}
       Log.i(TAG,"==> HomeCTIVITY初始化完毕");
}
 
开发者ID:HsingPeng,项目名称:ALLGO,代码行数:22,代码来源:HomeACTIVITY.java

示例2: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    /**
     * Get ListView and give it an adapter to display the sample items
     */
    ListView listView = getListView();
    ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
            ITEMS);
    listView.setAdapter(adapter);

    /**
     * Here we create a PullToRefreshAttacher manually without an Options instance.
     * PullToRefreshAttacher will manually create one using default values.
     */
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this);

    // Set the Refreshable View to be the ListView and the refresh listener to be this.
    mPullToRefreshAttacher.addRefreshableView(listView, this);
}
 
开发者ID:HsingPeng,项目名称:ALLGO,代码行数:22,代码来源:ListViewActivity.java

示例3: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_fragment_tabs);

    // The attacher should always be created in the Activity's onCreate
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this);

    // Add 3 tabs which will switch fragments
    ActionBar ab = getActionBar();
    ab.addTab(ab.newTab().setText("Tab 1").setTabListener(this));
    ab.addTab(ab.newTab().setText("Tab 2").setTabListener(this));
    ab.addTab(ab.newTab().setText("Tab 3").setTabListener(this));
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
 
开发者ID:HsingPeng,项目名称:ALLGO,代码行数:17,代码来源:FragmentTabsActivity.java

示例4: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_listview_empty);

    /**
     * Get ListView and give it an adapter to display the sample items
     */
    ListView listView = (ListView) findViewById(R.id.ptr_listview);
    mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
            new ArrayList<String>());
    listView.setEmptyView(findViewById(android.R.id.empty));
    listView.setAdapter(mAdapter);

    /**
     * Here we create a PullToRefreshAttacher manually without an Options instance.
     * PullToRefreshAttacher will manually create one using default values.
     */
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this);

    // Set the Refreshable View to be the ListView and the refresh listener to be this.
    PullToRefreshLayout ptrLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);
    ptrLayout.setPullToRefreshAttacher(mPullToRefreshAttacher, this);
}
 
开发者ID:HsingPeng,项目名称:ALLGO,代码行数:25,代码来源:ListViewWithEmptyActivity.java

示例5: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Display the fragment as the main content.
    getActionBar().setDisplayHomeAsUpEnabled(true);
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this);
    getSupportFragmentManager().beginTransaction().replace(android.R.id.content,
            new UnreadFRAGMENT()).commit();
}
 
开发者ID:HsingPeng,项目名称:ALLGO,代码行数:10,代码来源:UnreadACTIVITY.java

示例6: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	// TODO 自动生成的方法存根
	super.onCreate(savedInstanceState);
	getActionBar().setDisplayHomeAsUpEnabled(true);
	getSupportFragmentManager().beginTransaction().replace(android.R.id.content,
               new MyHomePageFRAGMENT()).commit();
	mPullToRefreshAttacher = PullToRefreshAttacher.get(this);
	getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
 
开发者ID:HsingPeng,项目名称:ALLGO,代码行数:11,代码来源:MyEventACTIVITY.java

示例7: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gridview);

    GridView gridView = (GridView) findViewById(R.id.ptr_gridview);
    ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
            ITEMS);
    gridView.setAdapter(adapter);

    // As we're modifying some of the options, create an instance of
    // PullToRefreshAttacher.Options
    PullToRefreshAttacher.Options ptrOptions = new PullToRefreshAttacher.Options();

    // Here we make the refresh scroll distance to 75% of the GridView height
    ptrOptions.refreshScrollDistance = 0.75f;

    // Here we define a custom header layout which will be inflated and used
    ptrOptions.headerLayout = R.layout.customised_header;

    // Here we define a custom header transformer which will alter the header based on the
    // current pull-to-refresh state
    ptrOptions.headerTransformer = new CustomisedHeaderTransformer();

    // Here we create a PullToRefreshAttacher manually with the Options instance created above.
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this, ptrOptions);

    /**
     * As GridView is an AbsListView derived class, we create a new
     * AbsListViewDelegate instance. You do NOT need to do this if you're using
     * a supported scrollable Views. It is merely in this sample to show you how to set a
     * custom view delegate.
     */
    PullToRefreshAttacher.ViewDelegate handler = new AbsListViewDelegate();
    mPullToRefreshAttacher.addRefreshableView(gridView, handler, this);
}
 
开发者ID:HsingPeng,项目名称:ALLGO,代码行数:37,代码来源:GridViewActivity.java

示例8: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_scrollview);

    // Create new PullToRefreshAttacher
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this);

    // Retrieve the PullToRefreshLayout from the content view
    PullToRefreshLayout ptrLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);

    // Give the PullToRefreshAttacher to the PullToRefreshLayout, along with the refresh
    // listener (this).
    ptrLayout.setPullToRefreshAttacher(mPullToRefreshAttacher, this);
}
 
开发者ID:HsingPeng,项目名称:ALLGO,代码行数:16,代码来源:ScrollViewActivity.java

示例9: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_webview);

    /**
     * Get ListView and give it an adapter to display the sample items
     */
    mWebView = (WebView) findViewById(R.id.webview);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.setWebViewClient(new SampleWebViewClient());

    /**
     * Here we create a PullToRefreshAttacher without an Options instance.
     * PullToRefreshAttacher will manually create one using default values.
     */
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this);

    // Retrieve the PullToRefreshLayout from the content view
    PullToRefreshLayout ptrLayout = (PullToRefreshLayout) findViewById(R.id.ptr_webview);

    // Give the PullToRefreshAttacher to the PullToRefreshLayout, along with the refresh
    // listener (this).
    ptrLayout.setPullToRefreshAttacher(mPullToRefreshAttacher, this);

    // Finally make the WebView load something...
    mWebView.loadUrl("http://www.google.com");
}
 
开发者ID:HsingPeng,项目名称:ALLGO,代码行数:29,代码来源:WebViewActivity.java

示例10: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
	createTabs();
	pullToRefreshAttacher = PullToRefreshAttacher.get(this);
}
 
开发者ID:exmo,项目名称:GameLivreNFC,代码行数:8,代码来源:MainActivity.java

示例11: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
	getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);		
	super.onCreate(savedInstanceState, true);
	setContentView(R.layout.activity_rockets_list);
	// Show the Up button in the action bar.
	setupActionBar();
	mLvRockets = (ListView) findViewById(R.id.lvRockets);
	mLvRockets.setEmptyView(findViewById(android.R.id.empty));
	mLayoutRockets = (PullToRefreshLayout) findViewById(R.id.layoutRockets);
	mPullToRefreshAttacher = PullToRefreshAttacher.get(this);
	mLayoutRockets.setPullToRefreshAttacher(mPullToRefreshAttacher, this);		
	mGestureDetector = new GestureDetector(this, new GestureListener());
	mAdapter = new RocketsArrayAdapter(this,  mLensRocketService.getLocalRockets());
	mLvRockets.setAdapter(mAdapter);			
	mLvRockets.setOnItemClickListener(rocketClickListener);
	mLvRockets.setOnItemLongClickListener(rocketLongClickListener);
	
	mLvRockets.setOnTouchListener(new OnTouchListener() {			
		@Override
		public boolean onTouch(View v, MotionEvent event) {
			mGestureDetector.onTouchEvent(event);
			if (event.getAction() == MotionEvent.ACTION_UP) {
				if (mIsViewingPicture || mIsViewingVideo) {
					mViewingDialog.dismiss();
					mIsViewingPicture = false;
					mIsViewingVideo = false;
					if (mImagePicture != null) {
						mImagePicture = null;
					} else if (mVideoView != null) {
						mVideoView.stopPlayback();
						mVideoView = null;
					}						
				}
			}
			return false;
		}
	});
}
 
开发者ID:Microsoft,项目名称:Android-LensRocket,代码行数:41,代码来源:RocketsListActivity.java

示例12: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gridview);

    GridView gridView = (GridView) findViewById(R.id.ptr_gridview);
    ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
            ITEMS);
    gridView.setAdapter(adapter);

    // As we're modifying some of the options, create an instance of
    // PullToRefreshAttacher.Options
    PullToRefreshAttacher.Options ptrOptions = new PullToRefreshAttacher.Options();

    // Here we make the refresh scroll distance to 75% of the GridView height
    ptrOptions.refreshScrollDistance = 0.75f;

    // Here we customise the animations which are used when showing/hiding the header view
    ptrOptions.headerInAnimation = R.anim.slide_in_top;
    ptrOptions.headerOutAnimation = R.anim.slide_out_top;

    // Here we define a custom header layout which will be inflated and used
    ptrOptions.headerLayout = R.layout.customised_header;

    // Here we define a custom header transformer which will alter the header based on the
    // current pull-to-refresh state
    ptrOptions.headerTransformer = new CustomisedHeaderTransformer();

    // Here we create a PullToRefreshAttacher manually with the Options instance created above.
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this, ptrOptions);

    /**
     * As GridView is an AbsListView derived class, we create a new
     * AbsListViewDelegate instance. You do NOT need to do this if you're using
     * a supported scrollable Views. It is merely in this sample to show you how to set a
     * custom view delegate.
     */
    PullToRefreshAttacher.ViewDelegate handler = new AbsListViewDelegate();
    mPullToRefreshAttacher.addRefreshableView(gridView, handler, this);
}
 
开发者ID:riaval,项目名称:open-note,代码行数:41,代码来源:GridViewActivity.java

示例13: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_scrollview);

    // Create new PullToRefreshAttacher
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this);

    // Retrieve the PullToRefreshLayout from the content view
    PullToRefreshLayout ptrLayout = (PullToRefreshLayout) findViewById(R.id.ptr_layout);

    // Give the PullToRefreshAttacher to the PullToRefreshLayout, along with the refresh
    // listener (this).
    ptrLayout.setPullToRefreshAttacher(mPullToRefreshAttacher, this);

    // As we haven't set an explicit HeaderTransformer, we can safely cast the result of
    // getHeaderTransformer() to DefaultHeaderTransformer
    DefaultHeaderTransformer ht = (DefaultHeaderTransformer) mPullToRefreshAttacher
            .getHeaderTransformer();

    // As we're using a DefaultHeaderTransformer we can change the text which is displayed.
    // You should load these values from localised resources, but we'll just use static strings.
    ht.setPullText("Swipe Me!!!");
    ht.setRefreshingText("Refreshing :)");

    // DefaultHeaderTransformer allows you to change the color of the progress bar. Here
    // we set it to a dark holo green, loaded from our resources
    ht.setProgressBarColor(getResources().getColor(R.color.holo_dark_green));
}
 
开发者ID:riaval,项目名称:open-note,代码行数:30,代码来源:ScrollViewActivity.java

示例14: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_menu);

    String shortName = getIntent().getStringExtra(MenuActivity.EXTRA_MENSA_SHORTNAME);
    mensa = Mensa.getMensa(shortName);

    final ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeButtonEnabled(true);
    setTitle(mensa.getShortName());

    viewPager = (ViewPager) findViewById(R.id.container);
    viewPagerAdapter = new NavigationAdapter(viewPager, this, actionBar, getSupportFragmentManager());

    refresher = PullToRefreshAttacher.get(this);
    ((DefaultHeaderTransformer)refresher.getHeaderTransformer()).setProgressBarColor(
            ThemeHelper.getRefreshBarColor(this));

    int selectedDateIndex = 0;
    if (savedInstanceState != null) {
        if (savedInstanceState.containsKey(STATE_SELECTED_NAVIGATION_ITEM)) {
            selectedDateIndex = savedInstanceState.getInt(STATE_SELECTED_NAVIGATION_ITEM);
        }
        if (savedInstanceState.containsKey(STATE_WEEKLY_MENU)) {
            weeklyMenu = (WeeklyMenu) savedInstanceState.getSerializable(STATE_WEEKLY_MENU);
            Log.i(TAG, "Restored WeeklyMenu from state.");
        }
    }

    if (weeklyMenu != null && !weeklyMenu.isOutdated()) {
        Log.i(TAG, "Showing restored WeeklyMenu with index " + selectedDateIndex);
        viewPagerAdapter.displayMenu(weeklyMenu, selectedDateIndex);
    }

    setupBottomBar();
}
 
开发者ID:lukasniemeier,项目名称:mensaapp,代码行数:40,代码来源:MenuActivity.java

示例15: onCreate

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);



    users = new ArrayList<User>();


    ArrayList<User> initialUsers = new ArrayList<User>();

    User u = new User();
    u.id=2157036348l;
    User v = new User();
    v.id=102014181l;
    initialUsers.add(u);
    initialUsers.add(v);
    initialUsers.add(v);
    initialUsers.add(v);
    initialUsers.add(v);
    initialUsers.add(v);
    initialUsers.add(v);

    adapter=new UserAdapter(this, R.layout.user_card, users);
    setListAdapter(adapter);

    final ActionBar actionBar = getActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    ArrayList<String> itemList = new ArrayList<String>();
    itemList.add("My University");
    itemList.add("My Module");
    itemList.add("My Year");
    ArrayAdapter<String> aAdpt = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, itemList);
    actionBar.setListNavigationCallbacks(aAdpt, this);
    actionBar.setSelectedNavigationItem(1);


    // Create a PullToRefreshAttacher instance
    mPullToRefreshAttacher = PullToRefreshAttacher.get(this);

    // Add the Refreshable View and provide the refresh listener
    mPullToRefreshAttacher.addRefreshableView(getListView(), this);



    StartupTask t = new StartupTask();
    t.execute(initialUsers);
}
 
开发者ID:Guy-kun,项目名称:UniLink,代码行数:51,代码来源:Main.java


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