// Path: app/src/main/java/moe/yukinoneko/gcomic/base/IBaseView.java
// public interface IBaseView {
//     void init();
// }
// 
// Path: app/src/main/java/moe/yukinoneko/gcomic/base/ToolBarActivity.java
// public abstract class ToolBarActivity<T extends BasePresenter> extends BaseActivity<T> {
//     protected ActionBar mActionBar;
// 
//     @BindView(R.id.toolbar)
//     protected Toolbar mToolbar;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         initToolBar();
//     }
// 
//     protected void initToolBar() {
//         setSupportActionBar(mToolbar);
//         mActionBar = getSupportActionBar();
//         if (mActionBar != null) mActionBar.setDisplayHomeAsUpEnabled(true);
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()) {
//             case android.R.id.home:
//                 onBackPressed();
//                 break;
//         }
//         return super.onOptionsItemSelected(item);
//     }
// }
// 
// Path: app/src/main/java/moe/yukinoneko/gcomic/utils/Utils.java
// public class Utils {
// 
//     public static float dp2px(Context context, float dp) {
//         return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics());
//     }
// 
//     public static String getFirstCharacter(String str) {
//         return str.substring(0, 1);
//     }
// 
//     public static int getNavigationBarHeight(Context context) {
//         Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
//         DisplayMetrics dm1 = new DisplayMetrics();
//         display.getMetrics(dm1);
// 
//         DisplayMetrics dm2 = new DisplayMetrics();
//         if (Build.VERSION.SDK_INT >= 17) {
//             display.getRealMetrics(dm2);
//         } else {
//             try {
//                 Class c = Class.forName("android.view.Display");
//                 Method method = c.getMethod("getRealMetrics", DisplayMetrics.class);
//                 method.invoke(display, dm2);
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//         }
// 
//         return dm2.heightPixels - dm1.heightPixels;
//     }
// 
//     /**
//      * 判断网络是否连接
//      */
//     public static boolean isConnected(Context context) {
//         ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
// 
//         if (null != cm) {
//             NetworkInfo info = cm.getActiveNetworkInfo();
//             if (null != info && info.isConnected()) {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
//     /**
//      * 判断是否是 wifi 连接
//      */
//     public static boolean isWifi(Context context) {
//         ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
// 
//         return null != cm && cm.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI;
//     }
// 
//     public static String getVersionName(Context context) {
//         try {
//             PackageManager packageManager = context.getPackageManager();
//             PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0);
//             return packageInfo.versionName;
// 
//         } catch (PackageManager.NameNotFoundException e) {
//             e.printStackTrace();
//         }
//         return "unknown";
//     }
// 
//     public static boolean isNightMode(Context context) {
//         int uiMode = context.getResources().getConfiguration().uiMode;
//         int dayNightUiMode = uiMode & Configuration.UI_MODE_NIGHT_MASK;
// 
//         return dayNightUiMode == Configuration.UI_MODE_NIGHT_YES;
//     }
// }


import android.support.v7.widget.AppCompatTextView;
import butterknife.BindView;
import moe.yukinoneko.gcomic.R;
import moe.yukinoneko.gcomic.base.IBaseView;
import moe.yukinoneko.gcomic.base.ToolBarActivity;
import moe.yukinoneko.gcomic.utils.Utils;
/*
 * Copyright (C) 2016  SamuelGjk <samuel.alva@outlook.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package moe.yukinoneko.gcomic.module.about;



/**
 * Created by SamuelGjk on 2016/5/30.
 */
public class AboutActivity extends ToolBarActivity<AboutPresenter> implements IBaseView {
    @BindView(R.id.text_app_version) AppCompatTextView textAppVersion;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_about;
    }

    @Override
    protected void initPresenter() {
        presenter = new AboutPresenter(this, this);
        presenter.init();
    }

    @Override
    public void init() {
// Path: app/src/main/java/moe/yukinoneko/gcomic/base/IBaseView.java
// public interface IBaseView {
//     void init();
// }
// 
// Path: app/src/main/java/moe/yukinoneko/gcomic/base/ToolBarActivity.java
// public abstract class ToolBarActivity<T extends BasePresenter> extends BaseActivity<T> {
//     protected ActionBar mActionBar;
// 
//     @BindView(R.id.toolbar)
//     protected Toolbar mToolbar;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         initToolBar();
//     }
// 
//     protected void initToolBar() {
//         setSupportActionBar(mToolbar);
//         mActionBar = getSupportActionBar();
//         if (mActionBar != null) mActionBar.setDisplayHomeAsUpEnabled(true);
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()) {
//             case android.R.id.home:
//                 onBackPressed();
//                 break;
//         }
//         return super.onOptionsItemSelected(item);
//     }
// }
// 
// Path: app/src/main/java/moe/yukinoneko/gcomic/utils/Utils.java
// public class Utils {
// 
//     public static float dp2px(Context context, float dp) {
//         return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics());
//     }
// 
//     public static String getFirstCharacter(String str) {
//         return str.substring(0, 1);
//     }
// 
//     public static int getNavigationBarHeight(Context context) {
//         Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
//         DisplayMetrics dm1 = new DisplayMetrics();
//         display.getMetrics(dm1);
// 
//         DisplayMetrics dm2 = new DisplayMetrics();
//         if (Build.VERSION.SDK_INT >= 17) {
//             display.getRealMetrics(dm2);
//         } else {
//             try {
//                 Class c = Class.forName("android.view.Display");
//                 Method method = c.getMethod("getRealMetrics", DisplayMetrics.class);
//                 method.invoke(display, dm2);
//             } catch (Exception e) {
//                 e.printStackTrace();
//             }
//         }
// 
//         return dm2.heightPixels - dm1.heightPixels;
//     }
// 
//     /**
//      * 判断网络是否连接
//      */
//     public static boolean isConnected(Context context) {
//         ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
// 
//         if (null != cm) {
//             NetworkInfo info = cm.getActiveNetworkInfo();
//             if (null != info && info.isConnected()) {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
//     /**
//      * 判断是否是 wifi 连接
//      */
//     public static boolean isWifi(Context context) {
//         ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
// 
//         return null != cm && cm.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI;
//     }
// 
//     public static String getVersionName(Context context) {
//         try {
//             PackageManager packageManager = context.getPackageManager();
//             PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0);
//             return packageInfo.versionName;
// 
//         } catch (PackageManager.NameNotFoundException e) {
//             e.printStackTrace();
//         }
//         return "unknown";
//     }
// 
//     public static boolean isNightMode(Context context) {
//         int uiMode = context.getResources().getConfiguration().uiMode;
//         int dayNightUiMode = uiMode & Configuration.UI_MODE_NIGHT_MASK;
// 
//         return dayNightUiMode == Configuration.UI_MODE_NIGHT_YES;
//     }
// }


// Path: app/src/main/java/moe/yukinoneko/gcomic/module/about/AboutActivity.java
import android.support.v7.widget.AppCompatTextView;
import butterknife.BindView;
import moe.yukinoneko.gcomic.R;
import moe.yukinoneko.gcomic.base.IBaseView;
import moe.yukinoneko.gcomic.base.ToolBarActivity;
import moe.yukinoneko.gcomic.utils.Utils;

/*
 * Copyright (C) 2016  SamuelGjk <samuel.alva@outlook.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package moe.yukinoneko.gcomic.module.about;



/**
 * Created by SamuelGjk on 2016/5/30.
 */
public class AboutActivity extends ToolBarActivity<AboutPresenter> implements IBaseView {
    @BindView(R.id.text_app_version) AppCompatTextView textAppVersion;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_about;
    }

    @Override
    protected void initPresenter() {
        presenter = new AboutPresenter(this, this);
        presenter.init();
    }

    @Override
    public void init() {
        textAppVersion.setText(getString(R.string.app_version, Utils.getVersionName(this)));