|
1 | 1 | package cn.wildfire.chat.kit.setting; |
2 | 2 |
|
| 3 | +import android.content.pm.PackageInfo; |
| 4 | +import android.content.pm.PackageManager; |
| 5 | +import android.widget.TextView; |
| 6 | + |
| 7 | +import butterknife.Bind; |
3 | 8 | import butterknife.OnClick; |
| 9 | +import cn.wildfire.chat.app.Config; |
4 | 10 | import cn.wildfire.chat.kit.WfcBaseActivity; |
5 | 11 | import cn.wildfire.chat.kit.WfcWebViewActivity; |
6 | 12 | import cn.wildfirechat.chat.R; |
7 | 13 |
|
8 | 14 | public class AboutActivity extends WfcBaseActivity { |
9 | 15 |
|
| 16 | + @Bind(R.id.infoTextView) |
| 17 | + TextView infoTextView; |
| 18 | + |
10 | 19 | @Override |
11 | 20 | protected int contentLayout() { |
12 | 21 | return R.layout.activity_about; |
13 | 22 | } |
14 | 23 |
|
| 24 | + @Override |
| 25 | + protected void afterViews() { |
| 26 | + PackageManager packageManager = getPackageManager(); |
| 27 | + try { |
| 28 | + PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), PackageManager.GET_CONFIGURATIONS); |
| 29 | + String info = packageInfo.packageName + "\n" |
| 30 | + + packageInfo.versionCode + " " + packageInfo.versionName + "\n" |
| 31 | + + Config.IM_SERVER_HOST + " " + Config.IM_SERVER_PORT + "\n" |
| 32 | + + Config.APP_SERVER_HOST + " " + Config.APP_SERVER_PORT + "\n" |
| 33 | + + Config.ICE_ADDRESS + " " + Config.ICE_USERNAME + " " + Config.ICE_PASSWORD + "\n"; |
| 34 | + |
| 35 | + infoTextView.setText(info); |
| 36 | + |
| 37 | + } catch (PackageManager.NameNotFoundException e) { |
| 38 | + e.printStackTrace(); |
| 39 | + } |
| 40 | + } |
| 41 | + |
15 | 42 | @OnClick(R.id.introOptionItemView) |
16 | 43 | public void intro() { |
17 | 44 | WfcWebViewActivity.loadUrl(this, "野火IM用户协议", "http://docs.wildfirechat.cn/"); |
|
0 commit comments