Skip to content

Commit

Permalink
update class format
Browse files Browse the repository at this point in the history
  • Loading branch information
HotBitmapGG committed Jun 27, 2017
1 parent d209e5c commit 6e427cd
Show file tree
Hide file tree
Showing 58 changed files with 6,436 additions and 8,186 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package com.hotbitmapgg.bilibili.module.common;

import butterknife.BindView;
import butterknife.OnClick;
import com.hotbitmapgg.bilibili.base.RxBaseActivity;
import com.hotbitmapgg.bilibili.utils.ShareUtil;
import com.hotbitmapgg.ohmybilibili.R;

import android.annotation.SuppressLint;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
Expand All @@ -16,91 +10,86 @@
import android.view.MenuItem;
import android.widget.TextView;

import com.hotbitmapgg.bilibili.base.RxBaseActivity;
import com.hotbitmapgg.bilibili.utils.ShareUtil;
import com.hotbitmapgg.ohmybilibili.R;

import butterknife.BindView;
import butterknife.OnClick;

/**
* Created by hcc on 16/8/7 14:12
* 100332338@qq.com
* <p/>
* App介绍界面
*/
public class AppIntroduceActivity extends RxBaseActivity {
@BindView(R.id.toolbar)
Toolbar mToolbar;
@BindView(R.id.tv_version)
TextView mVersion;
@BindView(R.id.tv_network_diagnosis)
TextView mTvNetworkDiagnosis;

@BindView(R.id.toolbar)
Toolbar mToolbar;

@BindView(R.id.tv_version)
TextView mVersion;

@BindView(R.id.tv_network_diagnosis)
TextView mTvNetworkDiagnosis;


@Override
public int getLayoutId() {

return R.layout.activity_app_introduce;
}


@SuppressLint("SetTextI18n")
@Override
public void initViews(Bundle savedInstanceState) {

mVersion.setText("v" + getVersion());
}


@Override
public void initToolBar() {

mToolbar.setTitle("关于");
setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
@Override
public int getLayoutId() {
return R.layout.activity_app_introduce;
}
}

@SuppressLint("SetTextI18n")
@Override
public void initViews(Bundle savedInstanceState) {
mVersion.setText("v" + getVersion());
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {

switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
@Override
public void initToolBar() {
mToolbar.setTitle("关于");
setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
return super.onOptionsItemSelected(item);
}


private String getVersion() {

try {
PackageInfo pi = getPackageManager()
.getPackageInfo(getPackageName(), 0);
return pi.versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return getString(R.string.about_version);
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
}


@OnClick(R.id.tv_share_app)
void shareApp() {
private String getVersion() {
try {
PackageInfo pi = getPackageManager().getPackageInfo(getPackageName(), 0);
return pi.versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return getString(R.string.about_version);
}
}

ShareUtil.shareLink(getString(R.string.github_url),
getString(R.string.share_title), AppIntroduceActivity.this);
}

@OnClick(R.id.tv_share_app)
void shareApp() {
ShareUtil.shareLink(getString(R.string.github_url),
getString(R.string.share_title), AppIntroduceActivity.this);
}

@OnClick(R.id.tv_feedback)
void showFeedbackDialog() {

new AlertDialog.Builder(AppIntroduceActivity.this)
.setTitle(R.string.feedback_titlle)
.setMessage(R.string.feedback_message)
.setPositiveButton("确定", (dialog, which) -> dialog.dismiss())
.show();
}
@OnClick(R.id.tv_feedback)
void showFeedbackDialog() {
new AlertDialog.Builder(AppIntroduceActivity.this)
.setTitle(R.string.feedback_titlle)
.setMessage(R.string.feedback_message)
.setPositiveButton("确定", (dialog, which) -> dialog.dismiss())
.show();
}
}
Loading

0 comments on commit 6e427cd

Please sign in to comment.