本文整理汇总了Java中android.support.v4.widget.SlidingPaneLayout.openPane方法的典型用法代码示例。如果您正苦于以下问题:Java SlidingPaneLayout.openPane方法的具体用法?Java SlidingPaneLayout.openPane怎么用?Java SlidingPaneLayout.openPane使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.widget.SlidingPaneLayout
的用法示例。
在下文中一共展示了SlidingPaneLayout.openPane方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.support.v4.widget.SlidingPaneLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sliding_pane_layout);
mSlidingLayout = (SlidingPaneLayout) findViewById(R.id.sliding_pane_layout);
mList = (ListView) findViewById(R.id.left_pane);
mContent = (TextView) findViewById(R.id.content_text);
mSlidingLayout.setPanelSlideListener(new SliderListener());
mSlidingLayout.openPane();
mList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
Shakespeare.TITLES));
mList.setOnItemClickListener(new ListItemClickListener());
mActionBar = createActionBarHelper();
mActionBar.init();
mSlidingLayout.getViewTreeObserver().addOnGlobalLayoutListener(new FirstLayoutListener());
}
示例2: showConversationsOverview
import android.support.v4.widget.SlidingPaneLayout; //导入方法依赖的package包/类
public void showConversationsOverview() {
if (mContentView instanceof SlidingPaneLayout) {
SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView;
mShouldPanelBeOpen.set(true);
mSlidingPaneLayout.openPane();
}
}
示例3: injectLayout
import android.support.v4.widget.SlidingPaneLayout; //导入方法依赖的package包/类
private void injectLayout() {
// for panel
mSlidingPaneLayout = (SlidingPaneLayout) findViewById(R.id.sliding_pane_layout);
mEmotions = (GridView) findViewById(R.id.emotions);
mEmotions.setAdapter(new EmotionsAdapter(this));
mEmotions.setOnItemClickListener(this);
mSlidingPaneLayout.setPanelSlideListener(new SliderListener());
mSlidingPaneLayout.openPane();
mSlidingPaneLayout.getViewTreeObserver().addOnGlobalLayoutListener(new FirstLayoutListener());
// for tweet
mAvatar = (ImageView) findViewById(R.id.avatar);
mScreenName = (TextView) findViewById(R.id.screen_name);
mText = (EditText) findViewById(R.id.text);
mLocationMarker = findViewById(R.id.location_marker);
// set data to layout...
new AsyncQueryHandler(getContentResolver()) {
@Override
protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
if (cursor.moveToNext()) {
Picasso.with(ComposeTweetActivity.this)
.load(cursor.getString(cursor.getColumnIndex(User.avatar_large)))
.placeholder(R.drawable.error)
.error(R.drawable.error)
.into(mAvatar);
mScreenName.setText("@" + cursor.getString(cursor.getColumnIndex(User.screen_name)));
}
cursor.close();
}
}.startQuery(0, null,
CatnutProvider.parse(User.MULTIPLE, mApp.getAccessToken().uid),
new String[]{User.avatar_large, User.screen_name}, null, null, null);
// other stuffs...
mText.addTextChangedListener(this);
}
示例4: showConversationsOverview
import android.support.v4.widget.SlidingPaneLayout; //导入方法依赖的package包/类
public void showConversationsOverview() {
if (mConversationFragment != null) {
mConversationFragment.stopScrolling();
}
if (mContentView instanceof SlidingPaneLayout) {
SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView;
mShouldPanelBeOpen.set(true);
mSlidingPaneLayout.openPane();
}
}
示例5: initViews
import android.support.v4.widget.SlidingPaneLayout; //导入方法依赖的package包/类
private void initViews(Bundle savedInstanceState) {
mSlidingPane = (SlidingPaneLayout) findViewById(R.id.sliding_pane);
mSlidingPane.setShadowResource(R.drawable.drawer_shadow);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction().add(R.id.pane1, UserFragment.newInstance(mUsername), "pane1").commit();
getSupportFragmentManager().beginTransaction().add(R.id.pane2, UserActionsFragment.newInstance(mUsername, UserActionsFragment.TYPE_ALL), "pane1").commit();
}
mSlidingPane.openPane();
}
示例6: onCreate
import android.support.v4.widget.SlidingPaneLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
slidingPanelLayout = (SlidingPaneLayout) findViewById(R.id.sliding_panel_layout);
if (slidingPanelLayout != null) {
slidingPanelLayout.openPane();
noServiceTextView = (TextView) findViewById(R.id.no_service);
serviceNameTextView = (TextView) findViewById(R.id.service_name);
lastUpdatedTextView = (TextView) findViewById(R.id.last_updated);
}
if (savedInstanceState == null) {
domain = "local.";
getSupportFragmentManager().beginTransaction().
replace(R.id.first_panel, RegTypeBrowserFragment.newInstance(Config.TCP_REG_TYPE_SUFFIX)).commit();
}
else{
domain = savedInstanceState.getString(PARAM_DOMAIN);
regType = savedInstanceState.getString(PARAM_REG_TYPE);
serviceName = savedInstanceState.getString(PARAM_SERVICE_NAME);
}
updateNavigation();
}
示例7: open
import android.support.v4.widget.SlidingPaneLayout; //导入方法依赖的package包/类
/**
* An action which sets whether the pane of {@code view} is open.
* <p>
* <em>Warning:</em> The created observable keeps a strong reference to {@code view}. Unsubscribe
* to free this reference.
*/
@CheckResult @NonNull public static Consumer<? super Boolean> open(
@NonNull final SlidingPaneLayout view) {
checkNotNull(view, "view == null");
return new Consumer<Boolean>() {
@Override public void accept(Boolean value) {
if (value) {
view.openPane();
} else {
view.closePane();
}
}
};
}
示例8: showConversationsOverview
import android.support.v4.widget.SlidingPaneLayout; //导入方法依赖的package包/类
public void showConversationsOverview() {
if (mConversationFragment != null) {
mConversationFragment.stopScrolling();
}
if (mContentView instanceof SlidingPaneLayout) {
SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView;
mShouldPanelBeOpen.set(true);
mSlidingPaneLayout.openPane();
}
}
示例9: showConversationsOverview
import android.support.v4.widget.SlidingPaneLayout; //导入方法依赖的package包/类
public void showConversationsOverview() {
if (mContentView instanceof SlidingPaneLayout) {
SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView;
mSlidingPaneLayout.openPane();
}
}
示例10: onCreate
import android.support.v4.widget.SlidingPaneLayout; //导入方法依赖的package包/类
@Override protected void onCreate(Bundle state) {
super.onCreate(state);
setContentView(R.layout.activity_settings);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
slidingPane = (SlidingPaneLayout) findViewById(R.id.sliding_pane);
slidingPane.setSliderFadeColor(getResources().getColor(R.color.preference_background));
slidingPane.setShadowResourceLeft(R.drawable.pane_shadow);
slidingPane.setPanelSlideListener(new SlidingPaneLayout.SimplePanelSlideListener() {
@Override
public void onPanelOpened(View panel) {
if (isPreferencesOpen()) {
resetPreferencePane();
}
}
});
slidingPane.openPane();
profileAdapter = new ProfileAdapter(this);
RecyclerView profileList = (RecyclerView) findViewById(R.id.profile_list);
profileList.setLayoutManager(new LinearLayoutManager(this));
profileList.setAdapter(profileAdapter);
fillPreferences();
getSupportLoaderManager().initLoader(G.PROFILES_LOADER_ID, null, profileLoaderCallbacks);
boolean showNewProfile = getIntent().getBooleanExtra(G.ARG_NEW_PROFILE, false);
if (state == null) {
TransmissionProfile.cleanTemporaryPreferences();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.registerOnSharedPreferenceChangeListener(defaultPrefListener);
prefs = getSharedPreferences(TransmissionProfile.getPreferencesName(),
Activity.MODE_PRIVATE);
prefs.registerOnSharedPreferenceChangeListener(profilesPrefListener);
} else {
showNewProfile = false;
}
if (showNewProfile) {
addFragment("new-profile", Type.PROFILE, null);
slidingPane.closePane();
}
}