Add sign in scene
This commit is contained in:
1 parent
3c3dd4a7e2
commit
08d0794fe8
15 files changed
+495
-47
No files matched your search
@@ -65,6 +65,8 @@ public class DrawerLeftPanel extends LinearLayout {
|
||||
|
||||
private boolean mSignIn;
|
||||
|
||||
private Helper mHelper;
|
||||
|
||||
private Messenger.Receiver mMessengerReceiver = new Messenger.Receiver() {
|
||||
@Override
|
||||
public void onReceive(int id, Object obj) {
|
||||
@@ -117,20 +119,37 @@ public class DrawerLeftPanel extends LinearLayout {
|
||||
mDrawerListView = (DrawerListView) getChildAt(1);
|
||||
|
||||
RippleSalon.addRipple(mAction, false);
|
||||
|
||||
mAvatar.setImageURI(DEFAULT_AVATAR_URI);
|
||||
mUsename.setText("");
|
||||
mAction.setText(mContext.getString(R.string.signin));
|
||||
mAction.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mHelper != null) {
|
||||
if (mSignIn) {
|
||||
mHelper.onClickSignOut();
|
||||
} else {
|
||||
mHelper.onClickSignIn();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mSuperUserPanelHeight = mSuperUserPanel.getLayoutParams().height;
|
||||
mUserPanelOriginalPaddingTop = mUserPanel.getPaddingTop();
|
||||
mDrawerListViewOriginalPaddingBottom = mDrawerListView.getPaddingBottom();
|
||||
|
||||
// TODO
|
||||
mAvatar.setImageURI(DEFAULT_AVATAR_URI);
|
||||
mUsename.setText("");
|
||||
mAction.setText(mContext.getString(R.string.signin));
|
||||
}
|
||||
|
||||
public DrawerListView getDrawerListView() {
|
||||
return mDrawerListView;
|
||||
}
|
||||
|
||||
public void setHelper(Helper helper) {
|
||||
mHelper = helper;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
@@ -217,4 +236,9 @@ public class DrawerLeftPanel extends LinearLayout {
|
||||
|
||||
return super.fitSystemWindows(insets);
|
||||
}
|
||||
|
||||
public interface Helper {
|
||||
void onClickSignIn();
|
||||
void onClickSignOut();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user