forked from gumingwei/WellSwipe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
718 additions
and
360 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
app/src/main/java/com/well/swipe/activitys/BaseSettingActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package com.well.swipe.activitys; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.widget.FrameLayout; | ||
import android.widget.LinearLayout; | ||
import android.widget.TextView; | ||
import android.widget.Toast; | ||
|
||
import com.well.swipe.R; | ||
|
||
|
||
/** | ||
* Created by mingwei on 6/21/16. | ||
*/ | ||
public abstract class BaseSettingActivity extends AppCompatActivity { | ||
|
||
private LinearLayout mBaseLayout; | ||
|
||
private FrameLayout mContentLayout; | ||
|
||
private View mBack; | ||
|
||
private TextView mTitle; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
mBaseLayout = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.base_setting_layout, null); | ||
mContentLayout = (FrameLayout) mBaseLayout.findViewById(R.id.base_content); | ||
mBack = mBaseLayout.findViewById(R.id.base_titlebar_back); | ||
mTitle = (TextView) mBaseLayout.findViewById(R.id.base_titlebar_title); | ||
mBack.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
leftBtnClick(); | ||
} | ||
}); | ||
} | ||
|
||
public void setContentView(int resId) { | ||
View view = LayoutInflater.from(this).inflate(resId, null); | ||
mContentLayout.removeAllViews(); | ||
mContentLayout.addView(view); | ||
setContentView(mBaseLayout); | ||
} | ||
|
||
public void leftBtnClick() { | ||
finish(); | ||
} | ||
|
||
public void setTitle(String title) { | ||
mTitle.setText(title); | ||
} | ||
|
||
public void setTitle(int titleId) { | ||
mTitle.setText(getResources().getString(titleId)); | ||
} | ||
|
||
public void isBack(boolean bool) { | ||
if (bool) { | ||
mBack.setVisibility(View.VISIBLE); | ||
} else { | ||
mBack.setVisibility(View.INVISIBLE); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.