125 lines
5.2 KiB
Java
125 lines
5.2 KiB
Java
package cn.com.magnity.magnitycx;
|
|
|
|
import android.content.pm.PackageInfo;
|
|
import android.content.pm.PackageManager;
|
|
import android.os.Bundle;
|
|
import android.support.annotation.Nullable;
|
|
import android.support.v4.app.Fragment;
|
|
import android.text.method.LinkMovementMethod;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.TextView;
|
|
import cn.com.magnity.magnitycx.sdk.UsbConnection;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class FragmentSupportAbout extends Fragment {
|
|
private PackageInfo packInfo_;
|
|
private SettingClickListener settingClickListener_;
|
|
private TextView tvCompanyCaption_;
|
|
private TextView tvCompany_;
|
|
private TextView tvHWVersionCaption_;
|
|
private TextView tvHWVersion_;
|
|
private TextView tvProductTypeCaption_;
|
|
private TextView tvProductType_;
|
|
private TextView tvRightCaption_;
|
|
private TextView tvRight_;
|
|
private TextView tvSWVersionCaption_;
|
|
private TextView tvSWVersion_;
|
|
|
|
@Override // android.support.v4.app.Fragment
|
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
this.settingClickListener_ = new SettingClickListener();
|
|
PackageManager packageManager = getActivity().getPackageManager();
|
|
try {
|
|
this.packInfo_ = packageManager.getPackageInfo(getActivity().getPackageName(), 0);
|
|
} catch (PackageManager.NameNotFoundException e) {
|
|
this.packInfo_ = null;
|
|
}
|
|
}
|
|
|
|
@Override // android.support.v4.app.Fragment
|
|
@Nullable
|
|
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
View rootView = inflater.inflate(R.layout.fragment_support_about, container, false);
|
|
View view = rootView.findViewById(R.id.id_productType);
|
|
this.tvProductTypeCaption_ = (TextView) view.findViewById(R.id.id_text1);
|
|
this.tvProductTypeCaption_.setText(R.string.productType);
|
|
this.tvProductType_ = (TextView) view.findViewById(R.id.id_text2);
|
|
if (UsbConnection.getInstance().isConnected()) {
|
|
switch (MagApplication.magParameter.basePara1.devType) {
|
|
case 0:
|
|
this.tvProductType_.setText(R.string.c1);
|
|
break;
|
|
case 1:
|
|
this.tvProductType_.setText(R.string.c3);
|
|
break;
|
|
case 2:
|
|
this.tvProductType_.setText(R.string.c3p);
|
|
break;
|
|
case 3:
|
|
this.tvProductType_.setText(R.string.core160);
|
|
break;
|
|
case 4:
|
|
default:
|
|
this.tvProductType_.setText("");
|
|
break;
|
|
case 5:
|
|
this.tvProductType_.setText(R.string.c1pro);
|
|
break;
|
|
case 6:
|
|
this.tvProductType_.setText(R.string.c1prolite);
|
|
break;
|
|
}
|
|
} else {
|
|
this.tvProductType_.setText("");
|
|
}
|
|
View view2 = rootView.findViewById(R.id.id_swVersion);
|
|
this.tvSWVersionCaption_ = (TextView) view2.findViewById(R.id.id_text1);
|
|
this.tvSWVersionCaption_.setText(R.string.swVersion);
|
|
this.tvSWVersion_ = (TextView) view2.findViewById(R.id.id_text2);
|
|
if (this.packInfo_ != null) {
|
|
this.tvSWVersion_.setText(this.packInfo_.versionName);
|
|
}
|
|
View view3 = rootView.findViewById(R.id.id_right);
|
|
this.tvRightCaption_ = (TextView) view3.findViewById(R.id.id_text1);
|
|
this.tvRightCaption_.setText(R.string.right);
|
|
this.tvRight_ = (TextView) view3.findViewById(R.id.id_text2);
|
|
this.tvRight_.setText(R.string.juge);
|
|
View view4 = rootView.findViewById(R.id.id_hwVersion);
|
|
this.tvHWVersionCaption_ = (TextView) view4.findViewById(R.id.id_text1);
|
|
this.tvHWVersionCaption_.setText(R.string.hwVersion);
|
|
this.tvHWVersion_ = (TextView) view4.findViewById(R.id.id_text2);
|
|
if (UsbConnection.getInstance().isConnected()) {
|
|
this.tvHWVersion_.setText(Integer.toString(MagApplication.magParameter.basePara1.hwVersion));
|
|
} else {
|
|
this.tvHWVersion_.setText("");
|
|
}
|
|
View view5 = rootView.findViewById(R.id.id_company);
|
|
this.tvCompanyCaption_ = (TextView) view5.findViewById(R.id.id_text1);
|
|
this.tvCompanyCaption_.setText(R.string.company);
|
|
this.tvCompany_ = (TextView) view5.findViewById(R.id.id_text2);
|
|
this.tvCompany_.setText("http://www.magnity.com.cn");
|
|
this.tvCompany_.setAutoLinkMask(15);
|
|
this.tvCompany_.setMovementMethod(LinkMovementMethod.getInstance());
|
|
return rootView;
|
|
}
|
|
|
|
@Override // android.support.v4.app.Fragment
|
|
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
|
super.onActivityCreated(savedInstanceState);
|
|
getActivity().setTitle(R.string.labelAbout);
|
|
}
|
|
|
|
private class SettingClickListener implements View.OnClickListener {
|
|
private SettingClickListener() {
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public void onClick(View v) {
|
|
v.getId();
|
|
}
|
|
}
|
|
}
|