@@ -9,6 +9,8 @@ import ai.pai.lensman.activities.AboutUsActivity; |
||
| 9 | 9 |
import ai.pai.lensman.activities.FeedbackActivity; |
| 10 | 10 |
import ai.pai.lensman.activities.WebViewActivity; |
| 11 | 11 |
import ai.pai.lensman.base.BaseActivity; |
| 12 |
+import ai.pai.lensman.db.Preferences; |
|
| 13 |
+import ai.pai.lensman.login.LoginActivity; |
|
| 12 | 14 |
import butterknife.ButterKnife; |
| 13 | 15 |
import butterknife.OnClick; |
| 14 | 16 |
|
@@ -46,4 +48,13 @@ public class SettingsActivity extends BaseActivity {
|
||
| 46 | 48 |
startActivity(new Intent(this, FeedbackActivity.class)); |
| 47 | 49 |
} |
| 48 | 50 |
|
| 51 |
+ @OnClick(R.id.btn_user_logout) |
|
| 52 |
+ void logout(){
|
|
| 53 |
+ Preferences.getInstance().setLensManId("");
|
|
| 54 |
+ Intent intent = new Intent(this, LoginActivity.class); |
|
| 55 |
+ intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); |
|
| 56 |
+ startActivity(intent); |
|
| 57 |
+ finish(); |
|
| 58 |
+ } |
|
| 59 |
+ |
|
| 49 | 60 |
} |
@@ -210,11 +210,25 @@ |
||
| 210 | 210 |
|
| 211 | 211 |
</LinearLayout> |
| 212 | 212 |
|
| 213 |
- </LinearLayout> |
|
| 214 |
- |
|
| 215 |
- |
|
| 216 |
- |
|
| 213 |
+ <Button |
|
| 214 |
+ android:id="@+id/btn_user_logout" |
|
| 215 |
+ android:layout_width="match_parent" |
|
| 216 |
+ android:layout_height="wrap_content" |
|
| 217 |
+ android:text="@string/logout_user" |
|
| 218 |
+ android:layout_gravity="center_horizontal" |
|
| 219 |
+ android:textSize="16sp" |
|
| 220 |
+ android:textColor="@color/white" |
|
| 221 |
+ android:background="@drawable/print_rounded_rect_bg" |
|
| 222 |
+ android:layout_marginLeft="20dp" |
|
| 223 |
+ android:layout_marginRight="20dp" |
|
| 224 |
+ android:layout_marginTop="8dp" |
|
| 225 |
+ android:layout_marginBottom="8dp" |
|
| 226 |
+ android:paddingLeft="35dp" |
|
| 227 |
+ android:paddingRight="35dp" |
|
| 228 |
+ android:paddingBottom="5dp" |
|
| 229 |
+ android:paddingTop="5dp"/> |
|
| 217 | 230 |
|
| 231 |
+ </LinearLayout> |
|
| 218 | 232 |
|
| 219 | 233 |
</ScrollView> |
| 220 | 234 |
|
@@ -146,4 +146,6 @@ |
||
| 146 | 146 |
<string name="sdcard_error">保存照片失败,请检查手机存储卡</string> |
| 147 | 147 |
|
| 148 | 148 |
<string name="scan_login_qr_error">扫描授权码失败</string> |
| 149 |
+ |
|
| 150 |
+ <string name="logout_user">退出登录</string> |
|
| 149 | 151 |
</resources> |