liufuhua007

first version

Showing 592 changed files with 4818 additions and 0 deletions
/.idea
/.gradle
\ No newline at end of file
/build
\ No newline at end of file
No preview for this file type
apply plugin: 'com.android.application'
android {
def version = "1.0.0"
def getVersionName = { ->
return "20230927"
}
def vcode = 1
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.sw.laryngoscope"
minSdkVersion 23
targetSdkVersion 30
versionCode vcode
versionName "V" + version + "_" + getVersionName()
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
ndk {
abiFilters 'armeabi-v7a', "arm64-v8a"
}
}
signingConfigs {
debug {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('./AOSP.keystore')
storePassword 'android'
}
relase {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('./AOSP.keystore')
storePassword 'android'
}
}
buildTypes {
release {
// 混淆
minifyEnabled false
/*// Zipalign优化
zipAlignEnabled true
// 移除无用的resource文件
shrinkResources true*/
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.relase
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
//自动生成指定名称的release发布版的 apk文件
android.applicationVariants.all { variant ->
def appName
if (project.hasProperty("applicationName")) {
appName = applicationName
} else {
appName = parent.name
}
variant.outputs.all { output ->
outputFileName = appName + "_V" + version + "_" + getVersionName() + ".apk"
}
}
sourceSets {
main {
//jniLibs.srcDir 'src/main/jniLibs'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
packagingOptions {
//exclude 'lib/armeabi-v7a/libc++_shared.so' // 过滤该文件
}
}
String getDate() {
Date date = new Date();
return date.format("MMM dd yyyy HH:mm:ss", Locale.ENGLISH);
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'org.jetbrains:annotations:15.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:23.4.0'
implementation files('libs/org.litepal.guolin_3.2.3.jar')
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:4.1.0'
implementation 'com.squareup.okio:okio:1.9.0'
implementation('com.jakewharton:butterknife:10.0.0') {
exclude group: 'com.android.support'
}
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
implementation 'com.github.bumptech.glide:glide:4.0.0'
implementation 'androidx.appcompat:appcompat:1.3.0-alpha02'
//implementation files('libs\\photoview.jar')
implementation 'com.itextpdf:itext7-core:7.1.13'
implementation 'com.github.barteksc:android-pdf-viewer:2.5.1'
//implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
implementation files('libs\\signature-pad.jar')
implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
implementation files('libs\\dcm4che-core-5.27.0.jar')
implementation files('libs\\dcm4che-net-5.27.0.jar')
implementation project(":ffmpeg")
implementation files('libs\\wifilibrary.jar')
compileOnly files('syslibs/framework.jar')
}
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
package com.sw.laryngoscope;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.sw.laryngoscope", appContext.getPackageName());
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.sw.laryngoscope">
<!-- android:sharedUserId="android.uid.system" >-->
<!--android:sharedUserId="android.uid.system"-->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<!-- 权限声明 -->
<!-- 访问网络状态-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<!-- 外置存储存取权限 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- 写文件的权限 -->
<uses-permission android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<!-- 多媒体相关 -->
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
<uses-permission android:name="android.permission.SET_TIME"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.SET_TIME_ZONE"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.RECOVERY"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.rockchip.update.permission.SHOW_UI"
tools:ignore="ProtectedPermissions" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-permission android:name="android.permission.CAMERA_OPEN_CLOSE_LISTENER"
tools:ignore="ProtectedPermissions" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:hardwareAccelerated="true"
android:theme="@style/NoTitle_FullScreen_NoTrans"
android:requestLegacyExternalStorage="true"
android:screenOrientation="landscape"
android:name="com.sw.laryngoscope.MyApplication" >
<!--android:theme="@style/AppTheme"-->
<!--android:theme="@style/NoTitle_FullScreen_NoTrans"-->
<!--android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"-->
<activity android:name="com.sw.laryngoscope.activity.login.LoginActivity"
android:authorities="${applicationId}.fileprovide"
android:configChanges=
"locale|touchscreen|keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|mcc
|mnc|navigation|fontScale" >
</activity>
<activity android:name="com.sw.laryngoscope.activity.HomeActivity"
android:authorities="${applicationId}.fileprovide"
android:configChanges=
"locale|touchscreen|keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|mcc
|mnc|navigation|fontScale"
android:launchMode="singleTop"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
</application>
</manifest>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<litepal>
<!-- 数据库名称 -->
<dbname value="LaryngoscopeDB" />
<!-- 数据库版本号 -->
<version value="7" />
<!-- 映射模型 -->
<list>
<mapping class="com.sw.laryngoscope.db.AccountInfoDB" />
<mapping class="com.sw.laryngoscope.db.RecordInfoDB" />
<mapping class="com.sw.laryngoscope.db.WifiInfoDB" />
</list>
</litepal>
\ No newline at end of file
package com.sw.laryngoscope;
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.provider.MediaStore;
import android.provider.Settings;
import android.view.Gravity;
import android.widget.Toast;
import androidx.annotation.RequiresApi;
import com.sw.laryngoscope.manager.AccountManager;
import com.sw.laryngoscope.manager.CameraCheck;
import com.sw.laryngoscope.manager.CameraInfoMg;
import com.sw.laryngoscope.manager.SpManager;
import com.sw.laryngoscope.manager.StorageStateManager;
import com.sw.laryngoscope.utils.LogcatHelper;
import com.sw.laryngoscope.utils.ShellUtils;
import com.sw.laryngoscope.utils.TimeUtil;
import com.sw.laryngoscope.utils.ZoneGetter;
import com.sw.laryngoscope.widget.SimplexToast;
import org.litepal.LitePal;
import org.litepal.LitePalApplication;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Locale;
import java.util.TimeZone;
public class MyApplication extends LitePalApplication {
private final String TAG = "MyApplication";
private static MyApplication instance;
static Context _context;
@RequiresApi(api = Build.VERSION_CODES.O)
@Override
public void onCreate() {
super.onCreate();
CameraInfoMg.getInstance(this);
LogcatHelper.getInstance(this).start();
//Logger.d(" onCreate " + (0x1<<2));
TimeUtil.init(this);
/*int b = 0 | (0x03 << 24);
Logger.d(" onCreate " + (b >>> 24));*/
Settings.System.putInt(getContentResolver(), Settings.System.ACCELEROMETER_ROTATION, 0);
ShellUtils.execCommand("wm density 160", true);
_context = getApplicationContext();
instance = this;
SpManager.init(getApplicationContext());
LitePal.initialize(this);
CameraCheck.getInstance(this);
AccountManager.getInstance().initList();
/*final List<Map<String, Object>> sortedList = ZoneGetter.getZonesList(this);
for(Map<String, Object> a:sortedList){
Logger.d(" sortedList " + a.values());
}*/
ZoneGetter mZoneGetter = new ZoneGetter();
mZoneGetter.getZones(getContext());
String[] zoneList = TimeZone.getAvailableIDs();
ArrayList<String> TZ1 = new ArrayList<String>();
for(String a:zoneList){
TimeZone d = TimeZone.getTimeZone(a);
// Logger.d(" getID " + d.getID());
// Logger.d(" getDisplayName " + d.getDisplayName());
// Logger.d(" showZonePop " + d.getDSTSavings());
//Logger.d(" showZonePop " + d.getRawOffset());
if ( !a.matches(".*/.*") ) {
continue;
}
/*for ( HashMap item:InitParam.zoneList ) {
if ( d.getID().equals(item.get(InitParam.ZONE_ID)) ) {
item.replace(InitParam.ZONE_COUNTRYNAME, d.getDisplayName(Locale.CHINA));
//item.replace()
//Logger.d(" getID " + d.getDisplayName(Locale.CHINA) + "" + d.get);
}
}*/
//if (TimeZone.getTimeZone(a).getRawOffset() / 3600 / 1000 == -5) {
//InitParam.zoneList.add(d.getDisplayName(false, TimeZone.LONG, Locale.CHINA));
//}
if(!(TZ1.contains(TimeZone.getTimeZone(a).getDisplayName(false, TimeZone.LONG, Locale.CHINA)))) {
TZ1.add(TimeZone.getTimeZone(a).getDisplayName(false, TimeZone.LONG, Locale.CHINA));
//InitParam.zoneList.add(d.getDisplayName(false, TimeZone.LONG, Locale.CHINA));
}
String region = a.replaceAll(".*/","").replaceAll("_"," ");
int hours = Math.abs(d.getRawOffset()) / 3600000;
int minutes = Math.abs(d.getRawOffset() / 60000) % 60;
String sign = d.getRawOffset() >= 0 ? "+" : "-";
String timeZonePretty = String.format("(UTC %s %02d:%02d) %s",sign,hours,minutes,region);
}
}
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
}
@Override
public void onTerminate() {
super.onTerminate();
}
public Context get_context() {
return _context;
}
public static MyApplication getInstance() {
return instance;
}
public static void showToastShort(String message) {
showToast(message, Toast.LENGTH_SHORT, 0, Gravity.BOTTOM);
}
public static void showToastLong(String message) {
showToast(message, Toast.LENGTH_LONG, 0, Gravity.BOTTOM);
}
public static void showToastLong1(String message) {
showToast1(message, Toast.LENGTH_LONG, 0, Gravity.BOTTOM);
}
public static void showToast(String message, int duration, int icon, int gravity) {
Context context = _context;
if (context != null)
SimplexToast.show(context, message, gravity, duration);
}
public static void showToast1(String message, int duration, int icon, int gravity) {
Context context = _context;
if (context != null)
SimplexToast.show1(context, message, gravity, duration);
}
public static Bitmap getVideoThumbnail(ContentResolver cr, String fileName) {
Bitmap bitmap = null;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inDither = false;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
//select condition.
String whereClause = MediaStore.Video.Media.DATA + " = '" + fileName + "'";
//colection of results.
Cursor cursor = cr.query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
new String[] { MediaStore.Video.Media._ID }, whereClause,
null, null);
if (cursor == null || cursor.getCount() == 0) {
return null;
}
cursor.moveToFirst();
//image id in image table.
String videoId = cursor.getString(cursor
.getColumnIndex(MediaStore.Video.Media._ID));
if (videoId == null) {
return null;
}
cursor.close();
long videoIdLong = Long.parseLong(videoId);
//via imageid get the bimap type thumbnail in thumbnail table.
bitmap = MediaStore.Video.Thumbnails.getThumbnail(cr, videoIdLong,
MediaStore.Images.Thumbnails.MICRO_KIND, options);
return bitmap;
}
}
\ No newline at end of file
package com.sw.laryngoscope.activity;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import butterknife.ButterKnife;
public abstract class BaseFragment extends Fragment
implements View.OnClickListener, HomeCallback {
protected View rootView;
public HomeActivity homeActivity;
public BaseFragment homeFragment;
public String TAG = "";
protected Context context;
public View.OnLongClickListener longClickListener = new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
return true;
}
};
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
TAG = getClass().getSimpleName();
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(rootLayout(), container, false);
ButterKnife.bind(this, rootView);
context = getActivity().getApplicationContext();
init();
setListener();
return rootView;
}
@Override
public void onResume() {
super.onResume();
if (rootView != null) {
rootView.setOnTouchListener(homeActivity);
}
}
@Override
public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden);
if (rootView != null) {
rootView.setOnTouchListener(homeActivity);
if (hidden) {
//隐藏的时候
rootView.setVisibility(View.GONE);
} else {
rootView.setVisibility(View.VISIBLE);
}
}
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
return true;
}
public boolean onKeyUp(int keyCode, KeyEvent event) {
return true;
}
public View getRootView() {
return rootView;
}
protected abstract int rootLayout();
protected abstract void init();
protected abstract void setListener();
private boolean isShowingPop = false;
public HomeCallback getHomeCallback() {
return this;
}
public void setHomeActivity(HomeActivity home) {
homeActivity = home;
}
public void setHomeFragment(BaseFragment homeFragment) {
this.homeFragment = homeFragment;
}
public void backHomeFragment() {
}
public void enterPlayWin(int position) {
}
public void backDetailFg() {
}
public void enterReportWin(int position) {
}
public void enterReportVideo() {
}
public void dispatchTouchEvent(MotionEvent ev) {
}
}
package com.sw.laryngoscope.activity;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
/**
* @Description 这里用一句话描述
* @Author
* @Time 2019/08/07
*/
public class CustomTimer {
private TimerCallBack mTimerCallBack;
private Timer mTimer;
private TimerTask mTimerTask;
/**
* 定时器的标志
*/
private String mTag;
/**
* 标志缓存
*/
private static List<String> cacheTag;
/**
* 总共执行了多少时间(s)
*/
private long mAllTime;
public CustomTimer() {
if (cacheTag == null) {
cacheTag = new ArrayList<>();
}
}
public interface TimerCallBack {
void timerComply(long lastTime, String tag);
}
public void setCallback(TimerCallBack callback) {
this.mTimerCallBack = callback;
}
public void setTag(String tag) {
if (cacheTag.contains(tag)) {
throw new RuntimeException("已存在同种定时器!");
}
this.mTag = tag;
cacheTag.add(mTag);
}
/**
* 设置统计时间
*
* @param allTime
*/
public void setmAllTime(long allTime) {
this.mAllTime = allTime;
}
/**
* 开始计时
*
* @param delay 延时
* @param callBack 回调
*/
public void startTimer(long delay, TimerCallBack callBack) {
startTimer(delay, null, callBack);
}
/**
* 开始计时
*
* @param delay 延时
* @param timerTask 自定义任务
* @param callBack 回调
*/
public void startTimer(long delay, TimerTask timerTask, TimerCallBack callBack) {
if (mTimer == null) {
mTimer = new Timer(true);
}
if (mTimerTask == null) {
mTimerTask = timerTask == null ? new LoopTask() : timerTask;
}
this.mTimerCallBack = callBack;
mTimer.schedule(mTimerTask, delay);
}
/**
* 开始计时
*
* @param delay 延时
* @param period 重复时间
* @param callBack 回调
*/
public void startTimer(long delay, long period, TimerCallBack callBack) {
if (mTimer == null) {
mTimer = new Timer(true);
}
if (mTimerTask == null) {
mTimerTask = new LoopTask();
}
this.mTimerCallBack = callBack;
mTimer.schedule(mTimerTask, delay, period);
}
/**
* 关闭计时
*/
public void closeTimer() {
if (mTimerTask != null) {
mTimerTask.cancel();
mTimerTask = null;
}
if (mTimer != null) {
mTimer.cancel();
mTimer = null;
}
if (cacheTag.contains(mTag)) {
cacheTag.remove(mTag);
}
mAllTime = 0;
}
class LoopTask extends TimerTask {
@Override
public void run() {
mAllTime++;
if (mTimerCallBack != null) {
mTimerCallBack.timerComply(mAllTime, mTag);
}
}
}
}
\ No newline at end of file
package com.sw.laryngoscope.activity;
import android.os.Handler;
import java.util.TimerTask;
/**
* @Description 发空消息的task
* @Author
* @Time 2019/07/20
*/
public class EmptyMessageTask extends TimerTask {
private Handler mHandler;
private int mWhat;
public EmptyMessageTask(Handler handler, int what){
if(handler == null){
throw new RuntimeException("你不传个handler给我,我闲着蛋疼呢?");
}
mHandler = handler;
mWhat = what;
}
@Override
public void run() {
mHandler.sendEmptyMessage(mWhat);
}
}
\ No newline at end of file
This diff is collapsed. Click to expand it.
package com.sw.laryngoscope.activity;
public interface HomeCallback {
void backMainAct();
boolean startEnable();
}
package com.sw.laryngoscope.activity; import android.content.Context; import com.sw.laryngoscope.base.BasePresenter; /** * @Description 这里用一句话描述 * @Author * @Time 2019/05/29 */public class HomePresenter extends BasePresenter<HomeView> { private Context context; void setContext(Context c) { context = c; } }
\ No newline at end of file
package com.sw.laryngoscope.activity;
import android.content.Context;
import com.sw.laryngoscope.base.BaseView;
/**
* @Description 这里用一句话描述
* @Author
* @Time 2019/05/29
*/
public interface HomeView extends BaseView {
Context getContext();
}
package com.sw.laryngoscope.activity.fragment.setting;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.activity.BaseFragment;
import com.sw.laryngoscope.activity.CustomTimer;
import com.sw.laryngoscope.activity.HomeActivity;
import com.sw.laryngoscope.common.InitParam;
import com.sw.laryngoscope.utils.Logger;
import butterknife.BindView;
import butterknife.OnClick;
public class LanFragment extends BaseFragment implements CustomTimer.TimerCallBack {
private static final String TAG = "LanFragment";
private Context context;
@BindView(R.id.lin_lan)
public LinearLayout lin_lan;
@BindView(R.id.txt_lan)
public TextView txt_lan;
@BindView(R.id.img_lan_next)
public ImageView img_lan_next;
private CustomTimer scrollTimer;
private final String timerTAG_scroll = "scroll";
@Override
public void onAttach(Context context) {
super.onAttach(context);
homeActivity = (HomeActivity) context;
}
@Override
public void onResume() {
super.onResume();
Logger.d(TAG, "======showFragment======2");
}
@Override
public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden);
if (!hidden) {
/*homeActivity.changeViewPage();
homeActivity.headIconStateChange(0);*/
initValue();
} else {
}
Logger.d(TAG, "======showFragment======2 " + hidden);
}
@Override
protected int rootLayout() {
return R.layout.fg_setting_lan;
}
@Override
protected void init() {
//layout_home_home_guest = (ConstraintLayout) rootView.findViewById(R.id.layout_home_home_guest);
initValue();
}
public void initValue() {
for (int i = 0; i < InitParam.LAN_TYPE_RES.length; i++ ) {
if ( getRootView().getResources().getConfiguration().locale.getLanguage()
.equals(InitParam.mLocale[i].getLanguage()) ) {
txt_lan.setText(InitParam.LAN_TYPE_RES[i]);
}
}
}
@Override
protected void setListener() {
}
@Override
@OnClick({ R.id.lin_lan, })
public void onClick(View v) {
switch (v.getId()) {
case R.id.lin_lan:
//homeFragment.backHomeFragment();
(new LanPopWindow(getContext())).showLanPop(lin_lan, txt_lan, img_lan_next);
break;
default:
break;
}
}
@Override
public void onDestroy() {
super.onDestroy();
}
@Override
public void timerComply(long lastTime, String tag) {
}
@Override
public void backMainAct() {}
@Override
public boolean startEnable() {
return false;
}
}
\ No newline at end of file
package com.sw.laryngoscope.activity.fragment.setting;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.Gravity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.adapter.LanItemAdapter;
import com.sw.laryngoscope.base.BaseActivity;
import com.sw.laryngoscope.common.InitParam;
import com.sw.laryngoscope.utils.AnimationUtil;
import com.sw.laryngoscope.utils.LanguageUtil;
import java.util.ArrayList;
import java.util.List;
public class LanPopWindow {
Context context;
LanItemAdapter mLanItemAdapter;
private PopupWindow lanChoosePop;
public LanPopWindow(Context context) {
this.context = context;
}
public void showLanPop(View view, TextView txtView, View arrow) {
int curPos = -1;
View bottomView = View.inflate(context, R.layout.layout_lan_choose, null);
ListView lt_user = bottomView.findViewById(R.id.lt_user);
List<String> arr = new ArrayList<>();
for (int item:InitParam.LAN_TYPE_RES ) {
arr.add(context.getString(item));
}
mLanItemAdapter = new LanItemAdapter(context, arr);
for ( int i = 0; i < InitParam.LAN_TYPE_RES.length; i++ ) {
if ( context.getResources().getConfiguration().locale.getLanguage()
.equals(InitParam.mLocale[i].getLanguage()) ) {
txtView.setText(InitParam.LAN_TYPE_RES[i]);
curPos = i;
}
}
lt_user.setAdapter(mLanItemAdapter);
lanChoosePop = new PopupWindow(bottomView, 1399,-2);
lanChoosePop.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
lanChoosePop.setTouchable(true);
lanChoosePop.setOutsideTouchable(true);
lanChoosePop.setFocusable(true);
lanChoosePop.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
AnimationUtil.animateArrow(arrow, false);
}
});
int[] location = new int[2];
view.getLocationOnScreen(location);
lanChoosePop.showAtLocation(view, Gravity.NO_GRAVITY, location[0], location[1] + view.getMeasuredHeight() + 10);
final int[] finalCurPos = {curPos};
lt_user.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick (AdapterView<?> parent, View view, int position, long id ) {
//Logger.d(" LanPopWindow onItemClick position " + position + " id " + id);
closePopupWindow();
AnimationUtil.animateArrow(arrow, false);
txtView.setText(context.getString(InitParam.LAN_TYPE_RES[(int)position]));
if ( position == finalCurPos[0]) {
return ;
}
finalCurPos[0] = position;
LanguageUtil.changeSystemLanguage60(InitParam.mLocale[(int)position], (BaseActivity)context);
}
});
AnimationUtil.animateArrow(arrow, true);
}
public void closePopupWindow() {
if (lanChoosePop != null && lanChoosePop.isShowing()) {
lanChoosePop.dismiss();
lanChoosePop = null;
}
}
}
package com.sw.laryngoscope.activity.fragment.setting;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.activity.BaseFragment;
import com.sw.laryngoscope.activity.CustomTimer;
import com.sw.laryngoscope.activity.HomeActivity;
import com.sw.laryngoscope.adapter.UsbItemAdapter;
import com.sw.laryngoscope.db.UsbInfoBean;
import com.sw.laryngoscope.manager.Storage;
import com.sw.laryngoscope.manager.StorageStateManager;
import com.sw.laryngoscope.utils.LogcatHelper;
import com.sw.laryngoscope.utils.Logger;
import com.sw.laryngoscope.utils.ShellUtils;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.OnClick;
public class LogExportFragment extends BaseFragment implements
CustomTimer.TimerCallBack, StorageStateManager.MountCallBack {
private static final String TAG = "LogExportFragment";
private Context context;
private CustomTimer scrollTimer;
private final String timerTAG_scroll = "scroll";
@BindView(R.id.listView_usb)
ListView listView_usb;
@BindView(R.id.lay_usb)
RelativeLayout lay_usb;
@BindView(R.id.sb_log)
SeekBar sb_log;
//@BindView(R.id.ptv_open_persentage)
//ProgressTextView ptv_open_persentage;
@BindView(R.id.txt_export)
TextView txt_export;
public UsbItemAdapter mUsbItemAdapter;
public List<UsbInfoBean> usbInfolist = new ArrayList<>();
int mProgress = 0;
@Override
public void onAttach(Context context) {
super.onAttach(context);
homeActivity = (HomeActivity) context;
}
@Override
public void onResume() {
super.onResume();
StorageStateManager.getInstance().setMountCallBackFun(this);
Logger.d(TAG, "======showFragment======2");
//禁用状态
sb_log.setClickable(false);
sb_log.setEnabled(false);
sb_log.setFocusable(false);
}
@Override
public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden);
if (!hidden) {
/*homeActivity.changeViewPage();
homeActivity.headIconStateChange(0);*/
initValue();
StorageStateManager.getInstance().setMountCallBackFun(this);
} else {
mHandler.removeMessages(MSG_COPY_LOG);
//StorageStateManager.getInstance().setMountCallBackFun(null);
lay_usb.setVisibility(View.GONE);
Logger.d(TAG, "======showFragment======2 " + hidden);
}
}
@Override
protected int rootLayout() {
return R.layout.fg_setting_log;
}
@Override
protected void init() {
//layout_home_home_guest = (ConstraintLayout) rootView.findViewById(R.id.layout_home_home_guest);
usbInfolist = new ArrayList<>();
mUsbItemAdapter = new UsbItemAdapter(getContext(), usbInfolist);
listView_usb.setAdapter(mUsbItemAdapter);
initValue();
}
public void initValue() {
if ( !Storage.isCheckExist(StorageStateManager.getInstance().getUdiskPath()) ) {
clearList();
lay_usb.setVisibility(View.GONE);
} else if ( Storage.isCheckExist(StorageStateManager.getInstance().getUdiskPath())
/*&& SpManager.get_usb_input_enabled()*/ ) {
txt_export.setEnabled(true);
initList(Storage.getUName(getContext()));
}
}
public void initList(String name) {
usbInfolist.clear();
UsbInfoBean usbInfoBean = new UsbInfoBean(name, true);
usbInfolist.add(usbInfoBean);
mUsbItemAdapter.setBeans(usbInfolist);
mUsbItemAdapter.notifyDataSetChanged();
sb_log.setProgress(0);
//ptv_open_persentage.setProgress(0, 0 + "%");
lay_usb.setVisibility(View.VISIBLE);
sb_log.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (!fromUser) {
mProgress = progress;
}
//ptv_open_persentage.setProgress(mProgress, mProgress + "%");
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
}
public int dip2px(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
public void clearList() {
usbInfolist.clear();
mUsbItemAdapter.setBeans(usbInfolist);
mUsbItemAdapter.notifyDataSetChanged();
}
@Override
protected void setListener() {
}
@Override
@OnClick({ R.id.txt_export })
public void onClick(View v) {
switch (v.getId()) {
case R.id.txt_export:
sb_log.setProgress(0);
txt_export.setEnabled(false);
mHandler.sendEmptyMessageDelayed(MSG_COPY_LOG, 500);
break;
default:
break;
}
}
public void setMountCallBack() {
StorageStateManager.getInstance().setMountCallBackFun(this);
}
@Override
public void onDestroy() {
super.onDestroy();
}
@Override
public void timerComply(long lastTime, String tag) {
}
@Override
public void backMainAct() {}
@Override
public boolean startEnable() {
return false;
}
@Override
public void MountEventProc(boolean mount) {
if ( mount /*&& SpManager.get_usb_input_enabled()*/ ) {
initList(Storage.getUName(getContext()));
txt_export.setEnabled(true);
} else {
clearList();
lay_usb.setVisibility(View.GONE);
mHandler.removeMessages(MSG_COPY_LOG);
//LogcatHelper.getInstance(context).stop();
}
}
private final Handler mHandler = new CpHandler();
private static final int MSG_COPY_LOG = 10000001;
private class CpHandler extends Handler {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MSG_COPY_LOG:
Log.d(TAG, "==.copyToUsb()1============");
int num = sb_log.getProgress();
int max = sb_log.getMax();
if ( num < max ) {
num += 1;
} else {
new Thread(new Runnable() {
@Override
public void run() {
LogcatHelper.getInstance(context).copyToUsb(
StorageStateManager.getInstance().getUdiskPath() + "/log/");
ShellUtils.execCommand("sync", true);
Log.d(TAG, "==.copyToUsb()3============");
}
}).start();
mProgress = 0;
//ptv_open_persentage.setProgress(0, 0 + "%");
sb_log.setProgress(0);
mHandler.removeMessages(MSG_COPY_LOG);
txt_export.setEnabled(true);
break;
}
sb_log.setProgress(num);
mHandler.sendEmptyMessageDelayed(MSG_COPY_LOG, 500);
break;
default:
break;
}
}
}
}
\ No newline at end of file
package com.sw.laryngoscope.activity.fragment.setting;
import android.app.AlarmManager;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.Gravity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.adapter.ZoneItemAdapter;
import com.sw.laryngoscope.common.InitParam;
import com.sw.laryngoscope.utils.AnimationUtil;
import com.sw.laryngoscope.utils.Logger;
import java.util.TimeZone;
import static com.sw.laryngoscope.common.InitParam.ZONE_ID;
public class ZonePopWindow {
Context context;
ZoneItemAdapter mZoneItemAdapter;
private PopupWindow zoneChoosePop;
public ZonePopWindow(Context context) {
this.context = context;
}
public void showZonePop(View view, final TextView txtView, View arrow) {
View bottomView = View.inflate(context, R.layout.layout_zone_choose, null);
ListView lt_zone = bottomView.findViewById(R.id.lt_zone);
mZoneItemAdapter = new ZoneItemAdapter(context, InitParam.zoneList);
lt_zone.setAdapter(mZoneItemAdapter);
//txtView.setText(TimeZone.getDefault().getID());
txtView.setText(TimeZone.getDefault().getDisplayName());
Logger.d(" getDisplayName 0 " + TimeZone.getDefault().getDisplayName());
zoneChoosePop = new PopupWindow(bottomView, 1399,600);
zoneChoosePop.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
zoneChoosePop.setTouchable(true);
zoneChoosePop.setOutsideTouchable(true);
zoneChoosePop.setFocusable(true);
zoneChoosePop.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
AnimationUtil.animateArrow(arrow, false);
}
});
int[] location = new int[2];
view.getLocationOnScreen(location);
zoneChoosePop.showAtLocation(view, Gravity.NO_GRAVITY, location[0], location[1] + view.getMeasuredHeight() + 10);
lt_zone.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick (AdapterView<?> parent, View view, int position, long id ) {
//changeSystemLanguage60(InitParam.mLocale[(int)id]);
AnimationUtil.animateArrow(arrow, false);
/*SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy hh:mm:ss z");
sdf.setTimeZone(TimeZone.getTimeZone( InitParam.zoneList.get((int)id) ));*/
context.getSystemService(AlarmManager.class)
.setTimeZone(TimeZone.getTimeZone( (String) InitParam.zoneList.get((int)id).get(ZONE_ID) ).getID());
/*AlarmManager mAlarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
mAlarmManager.setTimeZone("GMT+08:00");*/
//txtView.setText((String) InitParam.zoneList.get((int)id).get(ZONE_COUNTRYNAME));
txtView.setText(TimeZone.getTimeZone( (String) InitParam.zoneList.get((int)id).get(ZONE_ID) ).getDisplayName());
Logger.d(" getDisplayName 10 " + TimeZone.getDefault().getDisplayName());
/*txtView.setText( TimeZone.getTimeZone(
(String) InitParam.zoneList.get((int)id).get(ZONE_ID) ).getDisplayName() );
txtView.refreshDrawableState();*/
/*TimeZone tz = TimeZone.getTimeZone("Asia/Shanghai");
TimeZone.setDefault(tz);*/
Logger.d(" getDisplayName 1 " + TimeZone.getTimeZone( (String) InitParam.zoneList.get((int)id).get(ZONE_ID) ).getID());
txtView.postDelayed(runnable, 10000);
new Thread(new Runnable() {
@Override
public void run() {
Logger.i("onScrollStateChange: 不滑动 setSysTime ");
}
}).start();
if (zoneChoosePop != null && zoneChoosePop.isShowing()) {
zoneChoosePop.dismiss();
zoneChoosePop = null;
}
}
});
AnimationUtil.animateArrow(arrow, true);
}
Runnable runnable = new Runnable() {
@Override
public void run() {
Logger.d(" getDisplayName 2 " + TimeZone.getDefault().getID());
Logger.d(" getDisplayName 3 " + TimeZone.getAvailableIDs().toString());
}
};
//Android获取和设置时区
//http://bcoder.com/java/get-and-set-timezone-in-android
}
package com.sw.laryngoscope.activity.login;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.sw.laryngoscope.R;
/**
* 类说明:删除账号是否确认弹窗
* 创建人:
* 创建时间:2019-04-29
*/
public class DeleteaccountDialog extends Dialog {
private Context context;
private RelativeLayout cancel, confirm;
private TextView accounttext;
private Deleteaccountlistener deleteaccountlistener;
private String account;
public DeleteaccountDialog(Context context, String account, Deleteaccountlistener
deleteaccountlistener) {
super(context);
this.context = context;
this.account = account;
this.deleteaccountlistener = deleteaccountlistener;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setBackgroundDrawableResource(android.R.color.transparent);
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.dialog_deleteaccount, null);
setContentView(layout);
initview();
}
private void initview() {
cancel = findViewById(R.id.deleteaccount_cancel);
confirm = findViewById(R.id.deleteaccount_confirm);
accounttext = findViewById(R.id.deleteaccount_text);
accounttext.setText("确定删除账号[" + account + "]");
//删除账号取消
cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DeleteaccountDialog.this.dismiss();
}
});
//确定删除账号
confirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DeleteaccountDialog.this.dismiss();
deleteaccountlistener.deleteaccountsuccess();
}
});
}
}
package com.sw.laryngoscope.activity.login;
public interface Deleteaccountlistener {
void deleteaccountsuccess();
}
package com.sw.laryngoscope.activity.login; import android.content.Context; import com.sw.laryngoscope.base.BasePresenter; /** * @Description 这里用一句话描述 * @Author * @Time 2019/05/29 */public class LoginPresenter extends BasePresenter<LoginView> { private Context context; void setContext(Context c) { context = c; } }
\ No newline at end of file
package com.sw.laryngoscope.activity.login;
import android.content.Context;
import com.sw.laryngoscope.base.BaseView;
/**
* @Description 这里用一句话描述
* @Author
* @Time 2019/05/29
*/
public interface LoginView extends BaseView {
Context getContext();
}
package com.sw.laryngoscope.activity.login;
import com.sw.laryngoscope.db.AccountInfoDB;
import java.util.List;
/**
* 删除用户信息缓存回调
*/
public interface RemoveUserinfoListner {
void removeuserinfosuccess(int position, List<AccountInfoDB> data);
}
package com.sw.laryngoscope.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.common.InitParam;
import com.sw.laryngoscope.db.RecordInfoDB;
import com.sw.laryngoscope.utils.Logger;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class DetailGdItemAdapter extends RecyclerView.Adapter<DetailGdItemAdapter.ViewHolder> {
private Context context;
private List<RecordInfoDB> list;
public List<Boolean> checkList = new ArrayList<>();
private LayoutInflater mInflater;
private OnClickLitener listener;
private ViewHolder viewHolder;
private View view;
public void setList(List<RecordInfoDB> list) {
this.list = list;
checkList.clear();
for ( RecordInfoDB tmp:list ) {
checkList.add(false);
}
notifyDataSetChanged();
}
public void setCheckItem(int position) {
notifyDataSetChanged();
}
public void setAllCheck(boolean ischeck) {
checkList.clear();
for ( RecordInfoDB tmp:list ) {
checkList.add(ischeck);
}
}
public void setsingleCheck(int position) {
checkList.set(list.size() - position - 1, !checkList.get(list.size() - position - 1));
notifyDataSetChanged();
}
public void setRangeCheck(int startPosition, int endPosition) {
if ( startPosition < 0 || endPosition < 0 ) {
return ;
}
for ( int i = startPosition; i <= endPosition; i++ ) {
checkList.set(list.size() - i - 1, !checkList.get(list.size() - i - 1));
}
notifyDataSetChanged();
}
public void setSelected(int position, boolean selected) {
checkList.set(list.size() - position - 1, !checkList.get(list.size() - position - 1));
notifyDataSetChanged();
}
public void selectRangeChange(int start, int end, boolean isSelected) {
for ( int i = start; i <= end; i++ ) {
checkList.set(list.size() - i - 1, !checkList.get(list.size() - i - 1));
}
notifyDataSetChanged();
}
public int getCheckNum() {
int num = 0;
for ( boolean tmp:checkList ) {
if ( tmp ) {
num++;
}
}
return num;
}
public int getVideoNum() {
int num = 0, i = 0;
for ( boolean tmp:checkList ) {
if ( tmp ) {
RecordInfoDB temp = list.get( i );
if ( temp.getType() == InitParam.FILE_VIDEO ) {
num++;
}
}
i++;
}
return num;
}
public int getImageNum() {
int num = 0, i = 0;
for ( boolean tmp:checkList ) {
if ( tmp ) {
RecordInfoDB temp = list.get( i );
//Logger.d(" getVideoNum " + temp.getFilename() + " getType " + temp.getType());
if ( temp.getType() == InitParam.FILE_PHOTO ) {
num++;
}
}
i++;
}
return num;
}
public int getReportNum() {
int num = 0, i = 0;
for ( boolean tmp:checkList ) {
if ( tmp ) {
//Logger.d(" getVideoNum " + temp.getFilename() + " getType " + temp.getType());
num++;
}
i++;
}
return num;
}
public DetailGdItemAdapter(Context context, List<RecordInfoDB> list) {
this.context = context;
this.list = list;
for ( RecordInfoDB tmp:list ) {
checkList.add(false);
}
mInflater = LayoutInflater.from(context);
}
@Override
public int getItemCount() {
return list.size();
}
public int getCount() {
return list.size();
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
view = LayoutInflater.from(context).inflate(R.layout.item_file_detail, null);
viewHolder = new ViewHolder(view);
view.setOnLongClickListener(longClickListener);
return viewHolder;
}
@Override
public void onBindViewHolder(ViewHolder holder, @SuppressLint("RecyclerView") int position) {
RecordInfoDB temp = list.get( list.size() - position -1 );
String file;
if ( temp.getType() == InitParam.FILE_PHOTO ) {
holder.imagetype.setImageResource(R.mipmap.img_gallery);
file = temp.getFilepath() + File.separator + temp.getFilename();
} else if ( temp.getType() == InitParam.FILE_VIDEO ) {
holder.imagetype.setVisibility(View.VISIBLE);
holder.imagetype.setImageResource(R.mipmap.img_film);
file = temp.getThumbnailpath() + File.separator + temp.getThumbnailname();
} else {
holder.imagetype.setVisibility(View.VISIBLE);
holder.imagetype.setImageResource(R.mipmap.img_doc);
file = temp.getThumbnailpath() + File.separator + temp.getThumbnailname();
}
Glide.with(context).load( Uri.fromFile(new File(file)) ).into(holder.item_detail_img);
/*if ( listname.get(position).equals(context.getString(R.string.position_parlor))) {
holder.img_item.setImageResource(R.mipmap.parlor);
}
holder.tv_name.setText(listname.get(position));*/
holder.txt_name.setText(temp.getTitle());
holder.item_detail_img.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//int position = (Integer) v.getTag();
listener.onItemClick(list.size() - position -1);//数据库新日期在底部,但是显示时放在顶部,所以计算序号
}
});
holder.lay_checkbox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean isChecked = !holder.item_detail_checkbox.isChecked();
checkList.set(list.size() - position - 1, isChecked);
//Logger.d(" getImageNum " + getImageNum() + " isChecked " + isChecked + " position " + ( position ));
//Logger.d(" getVideoNum " + getVideoNum() + " checkList " + checkList.toString() + list.get(
// list.size() - position - 1).getFilename());
if ( listener != null ) {
listener.onSelClick(position, isChecked);
}
for ( RecordInfoDB tmp:list ) {
Logger.d(" getVideoNum " + tmp.getFilename() + " getType " + tmp.getType());
}
holder.item_detail_checkbox.setChecked(checkList.get(list.size() - position -1));
notifyDataSetChanged();
}
});
holder.item_detail_checkbox.setChecked(checkList.get(list.size() - position -1));
if ( checkList.get(list.size() - position -1) ) {
holder.txt_name.setTextColor(context.getResources().getColor(R.color.color_0aede0));
} else {
holder.txt_name.setTextColor(context.getResources().getColor(R.color.color_white));
}
}
/*holder.item_detail_checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if ( buttonView.isPressed() && listener != null ) {
checkList.set(list.size() - position - 1, isChecked);
//Logger.d(" getImageNum " + getImageNum() + " isChecked " + isChecked + " position " + ( position ));
//Logger.d(" getVideoNum " + getVideoNum() + " checkList " + checkList.toString() + list.get(
// list.size() - position - 1).getFilename());
listener.onSelClick(position, isChecked);
for ( RecordInfoDB tmp:list ) {
Logger.d(" getVideoNum " + tmp.getFilename() + " getType " + tmp.getType());
}
notifyDataSetChanged();
}
}
});*/
class ViewHolder extends RecyclerView.ViewHolder {
//@BindView(R.id.img_item)
ImageView item_detail_img;
ImageView imagetype;
//@BindView(R.id.tv_name)
CheckBox item_detail_checkbox;
RelativeLayout lay_checkbox;
TextView txt_name;
ViewHolder(View view) {
super(view);
//ButterKnife.bind(this, view);
item_detail_img = (ImageView)view.findViewById(R.id.item_detail_img);
imagetype = (ImageView)view.findViewById(R.id.imagetype);
item_detail_checkbox = (CheckBox)view.findViewById(R.id.item_detail_checkbox);
lay_checkbox = (RelativeLayout)view.findViewById(R.id.lay_checkbox);
txt_name = (TextView)view.findViewById(R.id.txt_name);
}
}
public OnClickLitener getListener() {
return listener;
}
public void setOnClickLitener(OnClickLitener listener) {
this.listener = listener;
}
public interface OnClickLitener {
void onItemClick(int position);
void onSelClick(int position, boolean isChecked);
}
public static int dip2px(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
private View.OnLongClickListener longClickListener;
public void setLongClickListener(View.OnLongClickListener clickListener) {
this.longClickListener = clickListener;
}
}
package com.sw.laryngoscope.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.db.DeviceInfoBean;
import java.util.List;
public class DeviceInfoItemAdapter extends BaseAdapter {
private String TAG = getClass().getSimpleName();
private LayoutInflater mInflater;
private OnClickListener mlisten;
private List<DeviceInfoBean> beans;
// 定义Context
private Context mContext;
public DeviceInfoItemAdapter(Context c, List<DeviceInfoBean> paramArrayList) {
mContext = c.getApplicationContext();
mInflater = LayoutInflater.from(c);
this.beans = paramArrayList;
}
public void setBeans(List<DeviceInfoBean> beans) {
this.beans = beans;
}
public int getCount() {
return beans.size();
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public void setUpdateListener(OnClickListener listen) {
mlisten = listen;
}
@SuppressLint("ResourceAsColor")
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if ( convertView == null ) {
holder = new ViewHolder();
convertView = mInflater.inflate(R.layout.item_device_info, null);
ListView.LayoutParams params = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT,39);//设置宽度和高度
convertView.setLayoutParams(params);
holder.txt_info = (TextView)convertView.findViewById(R.id.txt_info);
holder.txt_value = (TextView)convertView.findViewById(R.id.txt_value);
convertView.setTag(holder);
} else {
holder = (ViewHolder)convertView.getTag();
}
DeviceInfoBean bean = (DeviceInfoBean)this.beans.get(position);
holder.txt_info.setText(bean.getTxt_cap() + "");
holder.txt_value.setText(bean.getTxt_value() + "");
return convertView;
}
public final class ViewHolder {
public TextView txt_info;
public TextView txt_value;
}
public interface OnClickListener {
void onClickEvent(int id);
}
}
package com.sw.laryngoscope.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.db.FileDayBean;
import com.sw.laryngoscope.widget.IMGRigTopPointView;
import java.util.List;
public class FileItemAdapter extends BaseAdapter {
private String TAG = getClass().getSimpleName();
private LayoutInflater mInflater;
private OnClickListener mlisten;
private List<FileDayBean> beans;
private int pos;
// 定义Context
private Context mContext;
FileRvAdapter rvAdapter;
private int selPos = -1;
public FileItemAdapter(Context c, List<FileDayBean> paramArrayList, int pos, FileRvAdapter rvAdapter) {
mContext = c.getApplicationContext();
mInflater = LayoutInflater.from(c);
this.beans = paramArrayList;
this.pos = pos;
this.rvAdapter = rvAdapter;
selPos = -1;
}
public void setBeans(List<FileDayBean> beans) {
this.beans = beans;
}
public int getCount() {
/*Log.d(TAG, "==================" + mImageIds.length);*/
return beans.size();
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public void setUpdateListener(OnClickListener listen) {
mlisten = listen;
}
@SuppressLint("ResourceAsColor")
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
// Logger.d(" getView position " + position + " beans " + beans.size());
if ( convertView == null ) {
holder = new ViewHolder();
convertView = mInflater.inflate(R.layout.item_file_info, null);
//设置宽度和高度
ListView.LayoutParams params = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, 121);
convertView.setLayoutParams(params);
holder.lay_filelist = (LinearLayout)convertView.findViewById(R.id.lay_filelist);
holder.lay_value = (RelativeLayout)convertView.findViewById(R.id.lay_value);
holder.item_file_num = (ImageView)convertView.findViewById(R.id.item_file_num);
holder.txt_name = (TextView)convertView.findViewById(R.id.txt_name);
holder.txt_time = (TextView)convertView.findViewById(R.id.txt_time);
holder.txt_note = (TextView)convertView.findViewById(R.id.txt_note);
convertView.setTag(holder);
} else {
holder = (ViewHolder)convertView.getTag();
}
FileDayBean bean = this.beans.get(position);
if ( selPos == position ) {
//holder.lay_value.setBackgroundResource(R.drawable.bg_user_sideview_gray);
/*holder.lay_userlist.setBackgroundColor(
mContext.getResources().getColor(R.color.color_white));*/
} else {
//holder.lay_value.setBackgroundResource(R.drawable.bg_user_sideview);
}
holder.txt_name.setText(bean.getItemName());
holder.txt_time.setText(bean.getItemTime());
//holder.txt_note.setText("");
holder.txt_note.setText(bean.getNote());
holder.lay_value.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if ( rvAdapter.getListener() != null ) {
rvAdapter.getListener().onSubItemsFileClick(pos, position, bean.getItemName());
}
}
});
return convertView;
}
public final class ViewHolder {
public LinearLayout lay_filelist;
public RelativeLayout lay_value;
public ImageView item_file_num;
public TextView txt_name;
public TextView txt_time;
public TextView txt_note;
}
public interface OnClickListener {
void onClickEvent(int id);
}
}
package com.sw.laryngoscope.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.db.FileInfoMonthBean;
import com.sw.laryngoscope.widget.CustomListView;
import java.util.List;
public class FileRvAdapter extends RecyclerView.Adapter<FileRvAdapter.ViewHolder> {
private Context mContext;
private OnItemClickLitener listener;//点击事件接口
private List<FileInfoMonthBean> fileList;
private ViewHolder viewHolder;
private View view;
/**
* 在构造方法中传入图片地址的数据
* @param context
* @param list
*/
public FileRvAdapter(Context context, List<FileInfoMonthBean> list) {
this.mContext = context;
this.fileList = list;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
view = LayoutInflater.from(mContext).inflate(R.layout.rv_item_file, null);
viewHolder = new ViewHolder(view);
return viewHolder;
}
public void setBeanList(List<FileInfoMonthBean> list) {
this.fileList = list;
}
FileItemAdapter mFileItemAdapter;
@Override
public void onBindViewHolder(ViewHolder holder, @SuppressLint("RecyclerView") int position) {
//FileInfoBean temp = fileList.get( fileList.size() - position -1 );
FileInfoMonthBean temp = fileList.get( position );
holder.txt_title.setText(temp.getRvName());
setListViewHeightBasedOnChildren(holder.item_ls_file);
mFileItemAdapter = new FileItemAdapter(mContext, temp.getFileItemList(), position, this);
holder.item_ls_file.setAdapter(mFileItemAdapter);
//Logger.d(" getView position " + position + " onBindViewHolder " + temp.getFileItemList().size());
mFileItemAdapter.notifyDataSetChanged();
}
@Override
public int getItemCount() {
return fileList.size();
}
public OnItemClickLitener getListener() {
return listener;
}
public void setOnItemClickLitener(OnItemClickLitener listener) {
this.listener = listener;
}
public interface OnItemClickLitener {
void onSubItemsFileClick(int position, int subitemspos, String listMdItemName);
}
class ViewHolder extends RecyclerView.ViewHolder {
TextView txt_title;
CustomListView item_ls_file;
public ViewHolder(View itemView) {
super(itemView);
txt_title = (TextView) itemView.findViewById(R.id.txt_title);
item_ls_file = (CustomListView) itemView.findViewById(R.id.item_ls_file);
/*item_ls_file.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//int position = (Integer) v.getTag();
//listener.onItemClick(getPosition());
}
});*/
}
}
private void setListViewHeightBasedOnChildren(ListView listView) {
if (listView == null) {
return;
}
ListAdapter listAdapter = listView.getAdapter();
if (listAdapter == null) {
return;
}
int totalHeight = 0;
for (int i = 0; i < listAdapter.getCount(); i++) {
View listItem = listAdapter.getView(i, null, listView);
listItem.measure(0, 0);
totalHeight += listItem.getMeasuredHeight();
}
ViewGroup.LayoutParams params = listView.getLayoutParams();
params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
listView.setLayoutParams(params);
}
/*listView_user.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick (AdapterView<?> parent, View view, int position, long id ) {
if ( position == 0 ) {
return ;
}
}
});*/
}
package com.sw.laryngoscope.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.activity.fragment.archive.FileListMg;
import com.sw.laryngoscope.common.InitParam;
import com.sw.laryngoscope.db.FolderItemBean;
import com.sw.laryngoscope.utils.Logger;
import java.util.List;
public class FolderItemAdapter extends RecyclerView.Adapter<FolderItemAdapter.ViewHolder> {
private Context context;
private List<FolderItemBean> list;
private LayoutInflater mInflater;
private OnClickLitener listener;
private ViewHolder viewHolder;
private View view;
FileListMg mFileListMg;
public void setList(List<FolderItemBean> list) {
this.list = list;
notifyDataSetChanged();
}
public FolderItemAdapter(Context context, List<FolderItemBean> list, FileListMg fileListMg) {
this.context = context;
this.list = list;
mInflater = LayoutInflater.from(context);
mFileListMg = fileListMg;
}
@Override
public int getItemCount() {
return list.size();
}
public int getCount() {
return list.size();
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
view = LayoutInflater.from(context).inflate(R.layout.item_folder_detail, null);
viewHolder = new ViewHolder(view);
view.setOnLongClickListener(longClickListener);
return viewHolder;
}
@Override
public void onBindViewHolder(ViewHolder holder, @SuppressLint("RecyclerView") int position) {
FolderItemBean temp = list.get( list.size() - position -1 );
//Logger.d(" onBindViewHolder ------------- " + list.size());
if ( mFileListMg.curFoldLevel == InitParam.FOLDER_LEVEL.L_ONE.ordinal() ) {
holder.txt_name.setText(temp.getFdName());
} else if ( mFileListMg.curFoldLevel == InitParam.FOLDER_LEVEL.L_TWO.ordinal() ) {
if ( temp.isReport() ) {
holder.txt_name.setText(R.string.string_report_doc);
} else {
holder.txt_name.setText(temp.getListMonth());
}
}
holder.lay_0.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//int position = (Integer) v.getTag();
if ( mFileListMg.curFoldLevel == InitParam.FOLDER_LEVEL.L_ONE.ordinal() ) {
listener.onUserClick(temp.getFdName());
} else if ( mFileListMg.curFoldLevel == InitParam.FOLDER_LEVEL.L_TWO.ordinal() ) {
listener.onMonthClick(list.size() - position -1, temp.getListMonth(),
temp.getFdName(), temp.isReport());
}
}
});
/*if ( checkList.get(list.size() - position -1) ) {
holder.txt_name.setTextColor(context.getResources().getColor(R.color.color_0aede0));
} else {
holder.txt_name.setTextColor(context.getResources().getColor(R.color.color_white));
}*/
}
class ViewHolder extends RecyclerView.ViewHolder {
RelativeLayout lay_0;
//@BindView(R.id.img_item)
ImageView item_folder;
//@BindView(R.id.tv_name)
TextView txt_name;
ViewHolder(View view) {
super(view);
//ButterKnife.bind(this, view);
lay_0 = (RelativeLayout)view.findViewById(R.id.lay_0);
item_folder = (ImageView)view.findViewById(R.id.item_folder);
txt_name = (TextView)view.findViewById(R.id.txt_name);
}
}
public OnClickLitener getListener() {
return listener;
}
public void setOnClickLitener(OnClickLitener listener) {
this.listener = listener;
}
public interface OnClickLitener {
void onMonthClick(int position, String listMonth, String user, boolean isReport);
void onUserClick(String user);
}
public static int dip2px(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
private View.OnLongClickListener longClickListener;
public void setLongClickListener(View.OnLongClickListener clickListener) {
this.longClickListener = clickListener;
}
}
package com.sw.laryngoscope.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.common.InitParam;
import java.util.List;
public class LanItemAdapter extends BaseAdapter {
private String TAG = getClass().getSimpleName();
private LayoutInflater mInflater;
private OnClickListener mlisten;
private List<String> beans;
// 定义Context
private Context mContext;
public LanItemAdapter(Context c, List<String> paramArrayList) {
mContext = c.getApplicationContext();
mInflater = LayoutInflater.from(c);
this.beans = paramArrayList;
}
public void setBeans(List<String> beans) {
this.beans = beans;
}
/*public void setItemStatus(int item[]) {
beans = item;
}*/
/*public void setIsUpdate(int id, boolean param) {
isUpdate[id] = param;
}*/
public int getCount() {
/*Log.d(TAG, "==================" + mImageIds.length);*/
return beans.size();
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public void setUpdateListener(OnClickListener listen) {
mlisten = listen;
}
@SuppressLint("ResourceAsColor")
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if ( convertView == null ) {
holder = new ViewHolder();
convertView = mInflater.inflate(R.layout.item_lan_choose, null);
//设置宽度和高度
ListView.LayoutParams params = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, 68);
convertView.setLayoutParams(params);
holder.layout_lan_item = (LinearLayout)convertView.findViewById(R.id.layout_lan_item);
holder.item_lan = (TextView)convertView.findViewById(R.id.item_lan);
convertView.setTag(holder);
} else {
holder = (ViewHolder)convertView.getTag();
}
String bean = this.beans.get(position);
holder.item_lan.setText(bean + "");
if ( !mContext.getResources().getConfiguration().locale.getLanguage()
.equals(InitParam.mLocale[position].getLanguage()) ) {
holder.layout_lan_item.setBackgroundResource(R.drawable.bg_line_back_0);
/*holder.lay_userlist.setBackgroundColor(
mContext.getResources().getColor(R.color.color_white));*/
holder.item_lan.setTextColor(
mContext.getResources().getColor(R.color.color_white));
holder.item_lan.setTextSize(mContext.getResources().getDimension(R.dimen.text_size_24));
} else {
holder.layout_lan_item.setBackgroundResource(R.drawable.bg_line_back_1);
holder.item_lan.setTextColor(
mContext.getResources().getColor(R.color.color_0aede0));
holder.item_lan.setTextSize(mContext.getResources().getDimension(R.dimen.text_size_28));
}
return convertView;
}
public final class ViewHolder {
public LinearLayout layout_lan_item;
public TextView item_lan;
}
public interface OnClickListener {
void onClickEvent(int id);
}
}
package com.sw.laryngoscope.adapter;
import android.content.Context;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.common.InitParam;
import com.sw.laryngoscope.db.RecordInfoDB;
import com.sw.laryngoscope.widget.NiceImageView;
import java.io.File;
import java.util.List;
public class LeftVideoAdapter extends RecyclerView.Adapter<LeftVideoAdapter.ViewHolder> {
private Context mContext;
private OnItemClickLitener listener;//点击事件接口
private List<RecordInfoDB> imageUrls;//ArrayList<String>
//private ImageFetcher imageFetcher;
private ViewHolder viewHolder;
private View view;
/**
* 在构造方法中传入图片地址的数据
* @param context
* @param imageUrls
*/
public LeftVideoAdapter(Context context, List<RecordInfoDB> imageUrls) {
this.mContext = context;
this.imageUrls = imageUrls;
//初始化加载网络图片的jar包
/*imageFetcher = new ImageFetcher(context);
imageFetcher.setImageCache(ImageCache.getInstance(context));*/
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
view = LayoutInflater.from(mContext).inflate(R.layout.rv_item_left_video, null);
viewHolder = new ViewHolder(view);
return viewHolder;
}
public void setImageUrls(List<RecordInfoDB> imageUrls) {
this.imageUrls = imageUrls;
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
RecordInfoDB temp = imageUrls.get( imageUrls.size() - position -1 );
String file;
/*Logger.d("File.separator "+File.separator + " " + File.pathSeparator + " " + File.pathSeparatorChar
+ " " + File.separatorChar);*/
if ( temp.getType() == InitParam.FILE_PHOTO ) {
holder.imagePlay.setVisibility(View.GONE);
file = temp.getFilepath() + File.separator + temp.getFilename();
} else {
holder.imagePlay.setVisibility(View.VISIBLE);
file = temp.getThumbnailpath() + File.separator + temp.getThumbnailname();
}
Glide.with(mContext).load( Uri.fromFile(new File(file)) ).into(holder.imageView);
//holder.imageView.setBackgroundResource(R.mipmap.add);
/*//设置内容为“hehe”的的元素为默认的添加按钮
if (imageUrls.get(position).equals("hehe")) {
holder.imageView.setBackgroundResource(R.mipmap.add);
} else {
*//**
* 判断图片路径是网络地址还是本地图片
* 设置路径之中包含“storage”的为本地图片
*//*
if (imageUrls.get(position).contains("storage")) {
try {
File file = new File(imageUrls.get(position));
//将bitmap转化成drawable
Bitmap bmp = MediaStore.Images.Media.getBitmap(mContext.getContentResolver(), Uri.fromFile(file));
Drawable drawable =new BitmapDrawable(bmp);
//按比例扩大图片的size居中显示,使得图片长(宽)等于或大于View的长(宽)
holder.imageViewBig.setScaleType(ImageView.ScaleType.CENTER_CROP);
holder.imageViewBig.setImageBitmap(bmp);
} catch (IOException e) {
e.printStackTrace();
}
// holder.imageViewBig.setImageURI(Uri.parse(imageUrls.get(position)));
} else {
imageFetcher.loadImage(imageUrls.get(position), holder.imageViewBig, R.mipmap.touxiang);
}
}*/
}
@Override
public int getItemCount() {
return imageUrls.size();
}
public void setOnItemClickLitener(OnItemClickLitener listener) {
this.listener = listener;
}
public interface OnItemClickLitener {
void onItemClick(int position);
}
class ViewHolder extends RecyclerView.ViewHolder {
NiceImageView imageView;
ImageView imagePlay;
public ViewHolder(View itemView) {
super(itemView);
imageView = (NiceImageView) itemView.findViewById(R.id.imageView);
imagePlay = (ImageView) itemView.findViewById(R.id.imagePlay);
/**
*
* 因为元素是变化的,动态的,所以对点击事件的处理放在ViewHolder类里面,调用getposition()
* 可以获取到当前的元素位子
*/
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//int position = (Integer) v.getTag();
listener.onItemClick(getPosition());
}
});
}
}
}
package com.sw.laryngoscope.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.common.InitParam;
import com.sw.laryngoscope.db.RecordInfoDB;
import com.sw.laryngoscope.utils.Logger;
import java.io.File;
import java.util.List;
public class ListAdapter extends RecyclerView.Adapter<ListAdapter.ViewHolder> {
private Context context;
private List<RecordInfoDB> list;
private int curSelPos = 0;
private LayoutInflater mInflater;
private OnClickLitener listener;
public void setList(List<RecordInfoDB> list) {
this.list = list;
//notifyDataSetChanged();
}
public void setCheckItem(int position) {
curSelPos = position;
}
public ListAdapter(Context context, List<RecordInfoDB> list) {
this.context = context;
this.list = list;
mInflater = LayoutInflater.from(context);
}
static class ViewHolder extends RecyclerView.ViewHolder{
ImageView item_detail_img;
ImageView imagePlay;
LinearLayout lay_item_img;
public ViewHolder(View itemView) {
super(itemView);
item_detail_img = (ImageView) itemView.findViewById(R.id.item_detail_img);
imagePlay = (ImageView) itemView.findViewById(R.id.imagePlay);
lay_item_img = (LinearLayout) itemView.findViewById(R.id.lay_item_img);
}
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_file_video,
parent, false);
ViewHolder holder = new ViewHolder(view);
return holder;
}
@Override
public void onBindViewHolder(ViewHolder holder, @SuppressLint("RecyclerView") int position) {
if ( curSelPos == position ) {
holder.item_detail_img.setSelected(true);
} else {
holder.item_detail_img.setSelected(false);
}
RecordInfoDB temp = list.get( list.size() - position -1 );
String file;
if ( temp.getType() == InitParam.FILE_PHOTO ) {
holder.imagePlay.setVisibility(View.GONE);
file = temp.getFilepath() + File.separator + temp.getFilename();
} else {
holder.imagePlay.setVisibility(View.VISIBLE);
file = temp.getThumbnailpath() + File.separator + temp.getThumbnailname();
}
Glide.with(context).load( Uri.fromFile(new File(file)) ).into(holder.item_detail_img);
/*if ( listname.get(position).equals(context.getString(R.string.position_parlor))) {
viewHolder.img_item.setImageResource(R.mipmap.parlor);
}
viewHolder.tv_name.setText(listname.get(position));*/
holder.lay_item_img.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//int position = (Integer) v.getTag();
curSelPos = position;
listener.onItemClick(list.size() - position -1, true);//数组中正确位置
notifyDataSetChanged();
Logger.d(" lay_item_img onClick " + curSelPos);
}
});
}
@Override
public int getItemCount() {
return list.size();
}
public OnClickLitener getListener() {
return listener;
}
public void setOnClickLitener(OnClickLitener listener) {
this.listener = listener;
}
public interface OnClickLitener {
void onItemClick(int position, boolean isClick);
}
}
package com.sw.laryngoscope.adapter;
import android.content.Context;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.bumptech.glide.Glide;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.common.InitParam;
import com.sw.laryngoscope.db.RecordInfoDB;
import com.sw.laryngoscope.utils.Logger;
import java.io.File;
import java.util.List;
public class ShowGdItemAdapter extends BaseAdapter {
private Context context;
private List<RecordInfoDB> list;
private int curSelPos = 0;
private LayoutInflater mInflater;
private OnClickLitener listener;
public void setList(List<RecordInfoDB> list) {
this.list = list;
notifyDataSetChanged();
}
public void setCheckItem(int position) {
curSelPos = position;
}
public ShowGdItemAdapter(Context context, List<RecordInfoDB> list) {
this.context = context;
this.list = list;
mInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (convertView != null) {
viewHolder = (ViewHolder) convertView.getTag();
} else {
convertView = LayoutInflater.from(context).inflate(R.layout.item_file_video, null, false);
viewHolder = new ViewHolder(convertView);
convertView.setTag(viewHolder);
viewHolder.item_detail_img = (ImageView)convertView.findViewById(R.id.item_detail_img);
viewHolder.imagePlay = (ImageView)convertView.findViewById(R.id.imagePlay);
viewHolder.lay_item_img = (LinearLayout)convertView.findViewById(R.id.lay_item_img);
}
if ( curSelPos == position ) {
viewHolder.item_detail_img.setSelected(true);
} else {
viewHolder.item_detail_img.setSelected(false);
}
RecordInfoDB temp = list.get( list.size() - position -1 );
String file;
if ( temp.getType() == InitParam.FILE_PHOTO ) {
viewHolder.imagePlay.setVisibility(View.GONE);
file = temp.getFilepath() + File.separator + temp.getFilename();
} else {
viewHolder.imagePlay.setVisibility(View.VISIBLE);
file = temp.getThumbnailpath() + File.separator + temp.getThumbnailname();
}
Glide.with(context).load( Uri.fromFile(new File(file)) ).into(viewHolder.item_detail_img);
/*if ( listname.get(position).equals(context.getString(R.string.position_parlor))) {
viewHolder.img_item.setImageResource(R.mipmap.parlor);
}
viewHolder.tv_name.setText(listname.get(position));*/
viewHolder.lay_item_img.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//int position = (Integer) v.getTag();
curSelPos = position;
listener.onItemClick(list.size() - position -1);
notifyDataSetChanged();
Logger.d(" lay_item_img onClick " + curSelPos);
}
});
return convertView;
}
static class ViewHolder {
//@BindView(R.id.img_item)
ImageView item_detail_img;
ImageView imagePlay;
//@BindView(R.id.tv_name)
LinearLayout lay_item_img;
ViewHolder(View view) {
//ButterKnife.bind(this, view);
}
}
public OnClickLitener getListener() {
return listener;
}
public void setOnClickLitener(OnClickLitener listener) {
this.listener = listener;
}
public interface OnClickLitener {
void onItemClick(int position);
}
public static int dip2px(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
}
package com.sw.laryngoscope.adapter;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.view.View;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
public class SpaceItemDecoration extends RecyclerView.ItemDecoration{
private int leftRight;
private int topBottom;
public SpaceItemDecoration(int leftRight, int topBottom) {
this.leftRight = leftRight;
this.topBottom = topBottom;
}
@Override
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
super.onDraw(c, parent, state);
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
LinearLayoutManager layoutManager = (LinearLayoutManager) parent.getLayoutManager();
//竖直方向的
if (layoutManager.getOrientation() == LinearLayoutManager.VERTICAL) {
//最后一项需要 bottom
if (parent.getChildAdapterPosition(view) == layoutManager.getItemCount() - 1) {
outRect.bottom = topBottom;
}
outRect.top = topBottom;
outRect.left = leftRight;
outRect.right = leftRight;
} else {
//最后一项需要right
if (parent.getChildAdapterPosition(view) == layoutManager.getItemCount() - 1) {
outRect.right = leftRight;
}
outRect.top = topBottom;
outRect.left = leftRight;
outRect.bottom = topBottom;
}
}
}
package com.sw.laryngoscope.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.db.UsbInfoBean;
import com.sw.laryngoscope.utils.Logger;
import java.util.List;
public class UsbItemAdapter extends BaseAdapter {
private String TAG = getClass().getSimpleName();
private LayoutInflater mInflater;
private OnClickListener mlisten;
private List<UsbInfoBean> beans;
// 定义Context
private Context mContext;
public UsbItemAdapter(Context c, List<UsbInfoBean> paramArrayList) {
mContext = c.getApplicationContext();
mInflater = LayoutInflater.from(c);
this.beans = paramArrayList;
}
public void setBeans(List<UsbInfoBean> beans) {
this.beans = beans;
}
public int getCount() {
/*Log.d(TAG, "==================" + mImageIds.length);*/
return beans.size();
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public void setUpdateListener(OnClickListener listen) {
mlisten = listen;
}
@SuppressLint("ResourceAsColor")
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if ( convertView == null ) {
holder = new ViewHolder();
convertView = mInflater.inflate(R.layout.item_usb, null);
ListView.LayoutParams params = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT,81);//设置宽度和高度
convertView.setLayoutParams(params);
holder.lay_value = (RelativeLayout)convertView.findViewById(R.id.lay_value);
holder.txt_usertype = (TextView)convertView.findViewById(R.id.txt_usertype);
holder.img_sel = (ImageView)convertView.findViewById(R.id.img_sel);
convertView.setTag(holder);
} else {
holder = (ViewHolder)convertView.getTag();
}
UsbInfoBean bean = this.beans.get(position);
Logger.d(TAG, "---------UsbInfoBean.-------"
+ " position " + position);
holder.txt_usertype.setText(bean.getTxt_cap());
if ( bean.isSel() ) {
holder.lay_value.setSelected(false);
holder.img_sel.setSelected(false);
} else {
holder.lay_value.setSelected(true);
holder.img_sel.setSelected(true);
}
return convertView;
}
public final class ViewHolder {
public RelativeLayout lay_value;
public TextView txt_usertype;
public ImageView img_sel;
}
public interface OnClickListener {
void onClickEvent(int id);
}
}
package com.sw.laryngoscope.adapter;
import java.util.List;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.common.InitParam;
import com.sw.laryngoscope.db.AccountInfoDB;
import com.sw.laryngoscope.utils.Logger;
public class UserLoginItemAdapter extends BaseAdapter {
private String TAG = getClass().getSimpleName();
private LayoutInflater mInflater;
private OnClickListener mlisten;
private List<AccountInfoDB> beans;
// 定义Context
private Context mContext;
public UserLoginItemAdapter(Context c, List<AccountInfoDB> paramArrayList) {
mContext = c.getApplicationContext();
mInflater = LayoutInflater.from(c);
this.beans = paramArrayList;
}
public void setBeans(List<AccountInfoDB> beans) {
this.beans = beans;
}
public int getCount() {
/*Log.d(TAG, "==================" + mImageIds.length);*/
return beans.size();
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public void setUpdateListener(OnClickListener listen) {
mlisten = listen;
}
@SuppressLint("ResourceAsColor")
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if ( convertView == null ) {
holder = new ViewHolder();
convertView = mInflater.inflate(R.layout.item_user_login, null);
ListView.LayoutParams params = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT,120);//设置宽度和高度
convertView.setLayoutParams(params);
holder.lay_value = (RelativeLayout)convertView.findViewById(R.id.lay_value);
holder.txt_user_name = (TextView)convertView.findViewById(R.id.txt_user_name);
holder.img_usertype = (ImageView)convertView.findViewById(R.id.img_usertype);
holder.txt_usertype = (TextView)convertView.findViewById(R.id.txt_usertype);
holder.txt_login_status = (TextView)convertView.findViewById(R.id.txt_login_status);
holder.img_sel = (ImageView)convertView.findViewById(R.id.img_sel);
convertView.setTag(holder);
} else {
holder = (ViewHolder)convertView.getTag();
}
AccountInfoDB bean = this.beans.get(position);
Logger.d(TAG, "---------AccountInfoDB.-------" + bean.getPassword()
+ " position " + bean.getName() + " " + position
+ " isLogin " + bean.isLogin());
holder.img_usertype.setImageResource(InitParam.USER_TYPE_RES[bean.getUserType() - 1]);
holder.txt_usertype.setText(InitParam.USER_TYPE_STR[bean.getUserType() - 1]);
holder.txt_user_name.setText(bean.getName() + "");
if ( bean.isLogin() ) {
holder.txt_login_status.setText(R.string.string_loginin);
} else {
holder.txt_login_status.setText("");
}
if ( bean.getIsSelect() == 0 ) {
holder.lay_value.setSelected(false);
holder.img_sel.setSelected(false);
} else {
holder.lay_value.setSelected(true);
holder.img_sel.setSelected(true);
}
return convertView;
}
public final class ViewHolder {
public RelativeLayout lay_value;
public TextView txt_user_name;
public ImageView img_usertype;
public TextView txt_usertype;
public TextView txt_login_status;
public ImageView img_sel;
}
public interface OnClickListener {
void onClickEvent(int id);
}
}
package com.sw.laryngoscope.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiInfo;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kongqw.wifilibrary.WiFiManager;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.common.Constant;
import com.sw.laryngoscope.utils.Logger;
import com.sw.laryngoscope.wifi.WiFiBean;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class WifiListAdapter extends BaseAdapter {
private String TAG = getClass().getSimpleName();
private LayoutInflater mInflater;
private OnClickListener mlisten;
// 定义Context
private Context mContext;
private List<WiFiBean> beans;
public WifiListAdapter(Context c) {
mContext = c.getApplicationContext();
mInflater = LayoutInflater.from(c);
this.beans = new ArrayList();
}
public void setBeans(List<WiFiBean> beans) {
this.beans = beans;
}
public int getCount() {
/*Log.d(TAG, "==================" + mImageIds.length);*/
return beans.size();
}
public Object getItem(int position) {
return beans.get(position);
}
public long getItemId(int position) {
return position;
}
public void setUpdateListener(OnClickListener listen) {
mlisten = listen;
}
@SuppressLint("ResourceAsColor")
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if ( convertView == null ) {
holder = new ViewHolder();
convertView = mInflater.inflate(R.layout.item_wifi, null);
ListView.LayoutParams params = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT,78);//设置宽度和高度
convertView.setLayoutParams(params);
holder.lay_value = convertView.findViewById(R.id.lay_value);
holder.txt_name = convertView.findViewById(R.id.txt_name);
holder.img_con = convertView.findViewById(R.id.img_con);
convertView.setTag(holder);
} else {
holder = (ViewHolder)convertView.getTag();
}
WiFiBean mWiFiBean = this.beans.get(position);
holder.txt_name.setText("" + mWiFiBean.getResult().SSID);
if (mWiFiBean.getConnectStatus().equals(WiFiBean.CONNECT_ED)) {
Logger.e("position=" + position + "<Name>" + mWiFiBean.getResult().SSID + " 信号强度" + mWiFiBean.getRssi());
holder.lay_value.setSelected(true);
holder.img_con.setImageResource(R.mipmap.img_wifi_con);
} else if (mWiFiBean.getConnectStatus().equals(WiFiBean.CONNECT_ING)) {
holder.lay_value.setSelected(true);
holder.img_con.setImageResource(R.mipmap.img_wifi_con);
} else {
holder.lay_value.setSelected(false);
holder.img_con.setImageResource(R.mipmap.img_wifi_uncon);
}
return convertView;
}
public final class ViewHolder {
public RelativeLayout lay_value;
public TextView txt_name;
public ImageView img_con;
}
public int refreshData(List<ScanResult> list, WifiInfo mWifiInfo) {
int i = -101;
if ( list == null ) {
beans.clear();
notifyDataSetChanged();
return i;
} else {
list = WiFiManager.excludeRepetition(list);
beans.clear();
WiFiBean mWiFiBean = null;
for ( int k = 0; k < list.size(); k++ ) {
ScanResult mScanResult = list.get(k);
if ( Constant.isWifiOk && ("\"" + mScanResult.SSID + "\"").equals(mWifiInfo.getSSID()) ) {
i = mScanResult.level;
mWiFiBean = new WiFiBean(mScanResult, WiFiBean.CONNECT_ED, mScanResult.level);
if ( k != 0 ) {
for ( int j = beans.size()-1; j < 0; j-- ) {
beans.add(j+1, beans.get(j));
}
}
beans.add(0, mWiFiBean);
} else {
mWiFiBean = new WiFiBean(mScanResult, WiFiBean.CONNECT_UN, mScanResult.level);
beans.add(k, mWiFiBean);
}
}
notifyDataSetChanged();
return i;
}
}
public int setConnectedSSID(String ssid) {
Logger.e("setConnectedSSID=" + ssid);
int i = 0;
WiFiBean localWiFiBean;
while (i < this.beans.size()) {
localWiFiBean = (WiFiBean)this.beans.get(i);
localWiFiBean.setConnectStatus(WiFiBean.CONNECT_UN);
this.beans.set(i, localWiFiBean);
i += 1;
}
int j = -101;
i = 0;
while (i < this.beans.size()) {
localWiFiBean = (WiFiBean)this.beans.get(i);
if (("\"" + localWiFiBean.getResult().SSID + "\"").equals(ssid))
{
localWiFiBean.setConnectStatus(WiFiBean.CONNECT_ED);
Collections.swap(this.beans, i, 0);
j = localWiFiBean.getRssi();
}
i += 1;
}
notifyDataSetChanged();
return j;
}
public int setConnectingSSID(String ssid) {
int i = 0;
WiFiBean localWiFiBean;
while (i < this.beans.size()) {
localWiFiBean = (WiFiBean)this.beans.get(i);
localWiFiBean.setConnectStatus(WiFiBean.CONNECT_UN);
this.beans.set(i, localWiFiBean);
i += 1;
}
i = 0;
while (i < this.beans.size()) {
localWiFiBean = (WiFiBean)this.beans.get(i);
if ( ("\"" + localWiFiBean.getResult().SSID + "\"").equals(ssid) )
{
localWiFiBean.setConnectStatus(WiFiBean.CONNECT_ED);
this.beans.set(i, localWiFiBean);
}
i += 1;
}
notifyDataSetChanged();
return -101;
}
public interface OnClickListener {
void onClickEvent(int id);
}
}
package com.sw.laryngoscope.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.icu.text.TimeZoneNames;
import android.text.BidiFormatter;
import android.text.TextDirectionHeuristics;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import static com.sw.laryngoscope.common.InitParam.ZONE_COUNTRYNAME;
import static com.sw.laryngoscope.common.InitParam.ZONE_ID;
public class ZoneItemAdapter extends BaseAdapter {
private String TAG = getClass().getSimpleName();
private LayoutInflater mInflater;
private OnClickListener mlisten;
private List<HashMap<String, Object>> beans;
// 定义Context
private Context mContext;
public ZoneItemAdapter(Context c, List<HashMap<String, Object>> paramArrayList) {
mContext = c.getApplicationContext();
mInflater = LayoutInflater.from(c);
this.beans = paramArrayList;
}
public void setBeans(List<HashMap<String, Object>> beans) {
this.beans = beans;
}
/*public void setItemStatus(int item[]) {
beans = item;
}*/
/*public void setIsUpdate(int id, boolean param) {
isUpdate[id] = param;
}*/
public int getCount() {
/*Log.d(TAG, "==================" + mImageIds.length);*/
return beans.size();
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public void setUpdateListener(OnClickListener listen) {
mlisten = listen;
}
@SuppressLint("ResourceAsColor")
public View getView(final int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if ( convertView == null ) {
holder = new ViewHolder();
convertView = mInflater.inflate(R.layout.item_lan_choose, null);
//设置宽度和高度
ListView.LayoutParams params = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, 68);
convertView.setLayoutParams(params);
holder.layout_lan_item = (LinearLayout)convertView.findViewById(R.id.layout_lan_item);
holder.item_lan = (TextView)convertView.findViewById(R.id.item_lan);
convertView.setTag(holder);
} else {
holder = (ViewHolder)convertView.getTag();
}
HashMap<String, Object> bean = this.beans.get(position);
//holder.item_lan.setText( bean.get(ZONE_COUNTRYNAME) + "");
final Locale locale = Locale.getDefault();
final Date now = new Date();
TimeZone tz = TimeZone.getTimeZone((String)bean.get(ZONE_ID));
String displayName = getZoneDisplayName(locale, tz, now, false);
holder.item_lan.setText( displayName + "");
//holder.item_lan.setText( TimeZone.getTimeZone( (String)bean.get(ZONE_ID) ).getDisplayName() + "");
if ( !TimeZone.getDefault().getID().equals(
TimeZone.getTimeZone( (String)bean.get(ZONE_ID) ).getID() ) ) {
holder.layout_lan_item.setBackgroundResource(R.drawable.bg_line_back_0);
/*holder.lay_userlist.setBackgroundColor(
mContext.getResources().getColor(R.color.color_white));*/
holder.item_lan.setTextColor(
mContext.getResources().getColor(R.color.color_white));
holder.item_lan.setTextSize(mContext.getResources().getDimension(R.dimen.text_size_24));
} else {
holder.layout_lan_item.setBackgroundResource(R.drawable.bg_line_back_1);
holder.item_lan.setTextColor(
mContext.getResources().getColor(R.color.color_0aede0));
holder.item_lan.setTextSize(mContext.getResources().getDimension(R.dimen.text_size_28));
}
return convertView;
}
public final class ViewHolder {
public LinearLayout layout_lan_item;
public TextView item_lan;
}
public interface OnClickListener {
void onClickEvent(int id);
}
private String getZoneDisplayName(Locale locale, TimeZone tz, Date now,
boolean preferLongName) {
String zoneNameString;
if (preferLongName) {
zoneNameString = getZoneLongName(locale, tz, now);
} else {
zoneNameString = getZoneExemplarLocation(locale, tz);
if (zoneNameString == null || zoneNameString.isEmpty()) {
// getZoneExemplarLocation can return null.
zoneNameString = getZoneLongName(locale, tz, now);
}
}
return zoneNameString;
}
private String getZoneExemplarLocation(Locale locale, TimeZone tz) {
final TimeZoneNames timeZoneNames = TimeZoneNames.getInstance(locale);
return timeZoneNames.getExemplarLocationName(/*locale.toString(), */tz.getID());
}
private String getZoneLongName(Locale locale, TimeZone tz, Date now) {
boolean daylight = tz.inDaylightTime(now);
// This returns a name if it can, or will fall back to GMT+0X:00 format.
return tz.getDisplayName(daylight, TimeZone.LONG, locale);
}
/*public static String getTimeZoneOffsetAndName(TimeZone tz, Date now) {
Locale locale = Locale.getDefault();
String gmtString = getGmtOffsetString(locale, tz, now);
String zoneNameString = getZoneLongName(locale, tz, now);
if (zoneNameString == null) {
return gmtString;
}
// We don't use punctuation here to avoid having to worry about localizing that too!
return gmtString + " " + zoneNameString;
}
private static String getZoneLongName(Locale locale, TimeZone tz, Date now) {
boolean daylight = tz.inDaylightTime(now);
// This returns a name if it can, or will fall back to GMT+0X:00 format.
return tz.getDisplayName(daylight, TimeZone.LONG, locale);
}
private static String getGmtOffsetString(Locale locale, TimeZone tz, Date now) {
// Use SimpleDateFormat to format the GMT+00:00 string.
SimpleDateFormat gmtFormatter = new SimpleDateFormat("ZZZZ");
gmtFormatter.setTimeZone(tz);
String gmtString = gmtFormatter.format(now);
// Ensure that the "GMT+" stays with the "00:00" even if the digits are RTL.
BidiFormatter bidiFormatter = BidiFormatter.getInstance();
boolean isRtl = TextUtils.getLayoutDirectionFromLocale(locale) == View.LAYOUT_DIRECTION_RTL;
gmtString = bidiFormatter.unicodeWrap(gmtString,
isRtl ? TextDirectionHeuristics.RTL : TextDirectionHeuristics.LTR);
return gmtString;
}
public static String getTimeZoneText(TimeZone tz, boolean includeName) {
Date now = new Date();
SimpleDateFormat gmtFormatter = new SimpleDateFormat("ZZZZ");
gmtFormatter.setTimeZone(tz);
String gmtString = gmtFormatter.format(now);
BidiFormatter bidiFormatter = BidiFormatter.getInstance();
Locale l = Locale.getDefault();
boolean isRtl = TextUtils.getLayoutDirectionFromLocale(l) == View.LAYOUT_DIRECTION_RTL;
gmtString = bidiFormatter.unicodeWrap(gmtString,
isRtl ? TextDirectionHeuristics.RTL : TextDirectionHeuristics.LTR);
if (!includeName) {
return gmtString;
}
return gmtString;
}*/
}
package com.sw.laryngoscope.base;
import android.app.Activity;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import com.sw.laryngoscope.base.factory.PresenterFactory;
import com.sw.laryngoscope.base.factory.PresenterFactoryImpl;
import com.sw.laryngoscope.base.factory.PresenterProxy;
import com.sw.laryngoscope.base.factory.PresenterProxyImpl;
import com.sw.laryngoscope.utils.Logger;
import butterknife.ButterKnife;
/**
* @Description 继承自Activity的基类MvpActivity
* 使用代理模式来代理Presenter的创建、销毁、绑定、解绑以及Presenter的状态保存,其实就是管理Presenter的生命周期
* 首先在V层上定义需要创建的Presenter,声明自己模块具体的View接口类型和Presenter类型,最后实现自己View接口就ok了
* 如果要设置自己的Presenter创建工厂,必须在调用onResume方法和getPresenter方法之前设置
* @Author
* @Time 2019/05/29
*/
public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V>>
extends Activity implements BaseView, PresenterProxy<V, P> {
public String TAG;
private static final String PRESENTER_SAVE_KEY = "presenter_save_key";
private PresenterProxyImpl<V, P> mProxyImpl;
public View.OnLongClickListener longClickListener = new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
return true;
}
};
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
}
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
super.onCreate(savedInstanceState);
TAG = getClass().getSimpleName();
hideBottomUIMenu();
setContentView(getLayoutId());
ButterKnife.bind(this);
//创建被代理对象,传入默认Presenter的工厂
mProxyImpl = new PresenterProxyImpl<>(PresenterFactoryImpl.<V, P>createFactory(getClass()));
if (savedInstanceState != null) {
mProxyImpl.onRestoreInstanceState(savedInstanceState.getBundle(PRESENTER_SAVE_KEY));
}
}
@Override
protected void onResume() {
super.onResume();
mProxyImpl.onResume((V) this);
}
protected abstract int getLayoutId();
@Override
protected void onDestroy() {
super.onDestroy();
Logger.e(TAG, "V onDestroy ");
mProxyImpl.onDestroy();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBundle(PRESENTER_SAVE_KEY, mProxyImpl.onSaveInstanceState());
}
@Override
public void setPresenterFactory(PresenterFactory<V, P> presenterFactory) {
mProxyImpl.setPresenterFactory(presenterFactory);
}
@Override
public PresenterFactory<V, P> getPresenterFactory() {
return mProxyImpl.getPresenterFactory();
}
@Override
public P getPresenter() {
return mProxyImpl.getPresenter();
}
private void hideBottomUIMenu() {
//隐藏虚拟按键,并且全屏
if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) { // lower api
View v = getWindow().getDecorView();
v.setSystemUiVisibility(View.GONE);
} else if (Build.VERSION.SDK_INT >= 19) {
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}
}
}
\ No newline at end of file
package com.sw.laryngoscope.base;
import android.os.Bundle;
import android.os.Looper;
import android.os.Message;
import com.sw.laryngoscope.utils.Logger;
import org.jetbrains.annotations.Nullable;
/**
* @Description 这里用一句话描述
* @Author
* @Time 2019/05/29
*/
public abstract class BasePresenter<V extends BaseView> /*implements RxDataCallBack*/ {
private V view;
protected String TAG = "";
protected CmdHandler mCmdHandler;
private Message msg, msgNomal;
/**
* Presenter被创建后调用
*
* @param savedState 被意外销毁后重建后的Bundle
*/
public void onCreatePresenter(@Nullable Bundle savedState) {
TAG = getClass().getSimpleName();
Logger.i(TAG, "P onCreatePresenter");
mCmdHandler = new CmdHandler(Looper.getMainLooper(), this);
}
public void attachView(V v) {
if (v != null) {
this.view = v;
}
}
public V getView() {
return view;
}
public void deAttachView() {
if (view != null) {
this.view = null;
}
}
/**
* Presenter被销毁时调用
*/
public void onDestroyPresenter() {
Logger.i(TAG, "P onDestroyPresenter " + this);
}
/**
* 在Presenter意外销毁的时候被调用,它的调用时机和Activity、Fragment、View中的onSaveInstanceState时机相同
*
* @param outState
*/
public void onSaveInstanceState(Bundle outState) {
Logger.i("P onSaveInstanceState");
}
/**
* 处理数据返回
*
* @param msg
*/
public void handleCmdMsg(Message msg) {
switch (msg.what) {
default:
break;
}
}
/**
* 发送msg
*
* @param what 消息类型
*/
public void sendMsg(int what) {
//msg = new Message();
msg = Message.obtain();
msg.what = what;
mCmdHandler.sendMessage(msg);
}
/**
* 发送msg
*
* @param what 消息类型
* @param arg1 消息内容
*/
public void sendMsg(int what, int arg1) {
msg = Message.obtain();
msg.what = what;
msg.arg1 = arg1;
mCmdHandler.sendMessage(msg);
}
/**
* 发送msg
*
* @param what 消息类型
* @param arg1 消息内容1
* @param arg2 消息内容2
*/
protected void sendMsg(int what, int arg1, int arg2) {
msg = Message.obtain();
msg.what = what;
msg.arg1 = arg1;
msg.arg2 = arg2;
mCmdHandler.sendMessage(msg);
}
/**
* 发送msg
*
* @param what 消息类型
* @param obj obj
*/
protected void sendMsg(int what, Object obj) {
msg = Message.obtain();
msg.what = what;
msg.obj = obj;
mCmdHandler.sendMessage(msg);
}
}
\ No newline at end of file
package com.sw.laryngoscope.base;
/**
* @Description 这里用一句话描述
* @Author
* @Time 2019/05/29
*/
public interface BaseView {
/**
* 隐藏提示
*/
void hideTips();
}
\ No newline at end of file
package com.sw.laryngoscope.base;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
/**
* @Description 这里用一句话描述
* @Author
* @Time 2019/07/03
*/
public class CmdHandler extends Handler {
private BasePresenter mPresenter;
CmdHandler(Looper looper, BasePresenter presenter){
super(looper);
this.mPresenter = presenter;
}
@Override
public void handleMessage(Message msg) {
if(mPresenter == null){
return;
}
if(mPresenter.getView() == null){
return;
}
mPresenter.handleCmdMsg(msg);
}
}
\ No newline at end of file
package com.sw.laryngoscope.base.factory;
import com.sw.laryngoscope.base.BasePresenter;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* @Description 标注创建Presenter的注解,注意presenter的作用域
* @Author
* @Time 2019/05/29
*/
@Inherited
@Retention(RetentionPolicy.RUNTIME)
public @interface CreatePresenter {
Class<? extends BasePresenter> value();
}
\ No newline at end of file
package com.sw.laryngoscope.base.factory;
import com.sw.laryngoscope.base.BasePresenter;
import com.sw.laryngoscope.base.BaseView;
/**
* @Description 工厂模式创建presenter
* @Author
* @Time 2019/05/29
*/
public interface PresenterFactory<V extends BaseView,P extends BasePresenter<V>> {
/**
* 创建presenter
* @return
*/
P createPresenter();
}
\ No newline at end of file
package com.sw.laryngoscope.base.factory;
import com.sw.laryngoscope.base.BasePresenter;
import com.sw.laryngoscope.base.BaseView;
/**
* @Description 这里用一句话描述
* @Author
* @Time 2019/05/29
*/
public class PresenterFactoryImpl<V extends BaseView,P extends BasePresenter<V>> implements PresenterFactory<V,P>{
/** 需要创建的presenter*/
private final Class<P> mPresenterClass;
private PresenterFactoryImpl(Class<P> presenterClass){
this.mPresenterClass = presenterClass;
}
/**
* 根据注解创建presenter的工厂实现类
* @param viewClass 需要创建presenter的v层实现类
* @param <V> 当前view实现的接口类型
* @param <P> 当前要创建的presenter类型
* @return 工厂类
*/
public static <V extends BaseView,P extends BasePresenter<V>> PresenterFactoryImpl<V,P> createFactory(Class<?> viewClass){
CreatePresenter annotation = viewClass.getAnnotation(CreatePresenter.class);
return annotation == null?null:new PresenterFactoryImpl<>((Class<P>)annotation.value());
}
@Override
public P createPresenter() {
try {
return mPresenterClass.newInstance();
}catch (Exception e){
throw new RuntimeException("Presenter创建失败!,检查是否声明了@CreatePresenter(xx.class)注解");
}
}
}
\ No newline at end of file
package com.sw.laryngoscope.base.factory;
import com.sw.laryngoscope.base.BasePresenter;
import com.sw.laryngoscope.base.BaseView;
/**
* @Description 这里用一句话描述
* @Author
* @Time 2019/05/29
*/
public interface PresenterProxy<V extends BaseView,P extends BasePresenter<V>> {
/**
* 设置创建presenter的工厂
* @param presenterFactory
*/
void setPresenterFactory(PresenterFactory<V, P> presenterFactory);
/**
* 获取presenter的工厂类
* @return
*/
PresenterFactory<V,P> getPresenterFactory();
/**
* 获取创建的presenter
* @return
*/
P getPresenter();
}
\ No newline at end of file
package com.sw.laryngoscope.base.factory;
import android.os.Bundle;
import com.sw.laryngoscope.base.BasePresenter;
import com.sw.laryngoscope.base.BaseView;
import com.sw.laryngoscope.utils.Logger;
/**
* @Description 这里用一句话描述
* @Author
* @Time 2019/05/29
*/
public class PresenterProxyImpl<V extends BaseView, P extends BasePresenter<V>> implements PresenterProxy<V, P> {
private String TAG = "PresenterProxyImpl";
private static final String PRESENTER_KEY = "presenter_key";
private PresenterFactory<V, P> mPresenterFactory;
private P mPresenter;
private Bundle mBundle;
private boolean mIsAttchView;
public PresenterProxyImpl(PresenterFactory<V, P> presenterFactory) {
mPresenterFactory = presenterFactory;
}
/**
* 设置Presenter的工厂类,这个方法只能在创建Presenter之前调用,也就是调用getPresenter()之前,如果Presenter已经创建则不能再修改
*
* @param presenterFactory
*/
@Override
public void setPresenterFactory(PresenterFactory<V, P> presenterFactory) {
if (mPresenter != null) {
throw new IllegalArgumentException("这个方法只能在getPresenter()之前调用,如果Presenter已经创建则不能再修改!");
}
mPresenterFactory = presenterFactory;
}
@Override
public PresenterFactory<V, P> getPresenterFactory() {
return mPresenterFactory;
}
@Override
public P getPresenter() {
// Logger.i(TAG,"ProxyImpl getPresenter");
if (mPresenterFactory == null) {
throw new RuntimeException("PresenterFactory 创建失败!,检查当前activity是否有绑定presenter");
}
if (mPresenter == null) {
mPresenter = mPresenterFactory.createPresenter();
mPresenter.onCreatePresenter(mBundle == null ? null : mBundle.getBundle(PRESENTER_KEY));
}
// Logger.i(TAG,"ProxyImpl getPresenter = " + mPresenter);
return mPresenter;
}
/**
* 绑定Presenter和view
*
* @param view
*/
public void onResume(V view) {
getPresenter();
Logger.i(TAG, "ProxyImpl onResume");
if (mPresenter != null && !mIsAttchView) {
mPresenter.attachView(view);
mIsAttchView = true;
}
}
/**
* 销毁Presenter持有的View
*/
void onDeAttachView() {
Logger.i(TAG, "ProxyImpl onDeAttachView");
if (mPresenter != null && mIsAttchView) {
mPresenter.deAttachView();
mIsAttchView = false;
}
}
/**
* 销毁Presenter
*/
public void onDestroy() {
Logger.i(TAG, "ProxyImpl onDestroy");
if (mPresenter != null) {
onDeAttachView();
mPresenter.onDestroyPresenter();
mPresenter = null;
}
}
/**
* 意外销毁的时候调用
*
* @return 存入回调给Presenter的Bundle和当前Presenter的id
*/
public Bundle onSaveInstanceState() {
Logger.i(TAG, "ProxyImpl onSaveInstanceState");
Bundle bundle = new Bundle();
getPresenter();
if (mPresenter != null) {
Bundle presenterBundle = new Bundle();
mPresenter.onSaveInstanceState(presenterBundle);
bundle.putBundle(PRESENTER_KEY, presenterBundle);
}
return bundle;
}
/**
* 意外关闭恢复Presenter
*
* @param savedInstanceState savedInstanceState 意外关闭时存储的Bundler
*/
public void onRestoreInstanceState(Bundle savedInstanceState) {
Logger.i(TAG, "ProxyImpl onRestoreInstanceState");
Logger.i(TAG, "ProxyImpl onRestoreInstanceState Presenter = " + mPresenter);
mBundle = savedInstanceState;
}
}
\ No newline at end of file
package com.sw.laryngoscope.camera;
import android.content.ContentValues;
import android.hardware.Camera;
import android.media.CamcorderProfile;
import android.provider.MediaStore.Video;
import com.sw.laryngoscope.activity.fragment.HomeFragment;
import com.sw.laryngoscope.utils.Logger;
import java.io.File;
public class BaseModule {
public HomeFragment fragment;
public VideoUI mUI;
public VideoManager mVideoManager;
public static /*final*/ int FACING_BACK_ID = 0;
public static /*final*/ int FACING_FRONT_ID = 1;
//0 OV6946 //1 typec USBcamera //2 OV9734
public long mRecordingStartTime;
//public static long dateTaken = 0l;
public long stopTime = 0l;
public boolean mMediaRecorderRecording = false;
public int mMaxVideoDurationInMs = 3 * 60 * 1000;//2 * 60 * 1000;
public static final int MSG_UPDATE_RECORD_TIME = 5;
Camera frontCamera;
Camera backCamera;
public boolean isBackError = false;
//public static /*final*/ int TMP_CAM_ID = 0;
public void saveVideoFile(String fileName, ContentValues contentValues) {
try {
String finalName = contentValues.getAsString(Video.Media.DATA);
File finalFile = new File(finalName);
if (new File(fileName).renameTo(finalFile)) {
}
} catch (Exception e) {
}
}
public void deleteVideoFile(String fileName) {
File f = new File(fileName);
if (!f.delete()) {
}
}
public int getVideoQuality(int param) {
Logger.d(" -- param " + param);
int type = 0;
if ( param == 0 ) {
type = CamcorderProfile.QUALITY_HIGH;
} else if ( param == 1 ) {
type = CamcorderProfile.QUALITY_720P;
} else if ( param == 2 ) {
type = CamcorderProfile.QUALITY_480P;
}
return type;
}
public boolean isOpenCameraError() {
return isBackError ;
}
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
package com.sw.laryngoscope.camera;
import com.sw.laryngoscope.activity.fragment.HomeFragment;
import com.sw.laryngoscope.common.InitParam;
import com.sw.laryngoscope.utils.Logger;
public class VideoModule {
private HomeFragment fragment;
private VideoUI mUI;
private VideoManager mVideoManager;
private VideoCBModule mVideoCBModule;
private VideoCFModule mVideoCFModule;
private int mCameraType = InitParam.CAM_BACK;
public VideoModule() {
}
public void init(HomeFragment fragment) {
this.fragment = fragment;
mUI = new VideoUI(fragment, fragment.getRootView());
mVideoManager = new VideoManager(fragment.getActivity().getApplicationContext());
mVideoManager.startThread(fragment.getActivity().getApplicationContext());
mVideoCBModule = new VideoCBModule();
mVideoCBModule.init(fragment, mUI, mVideoManager);
mVideoCBModule.setmOnMediaListener(fragment);
mVideoCFModule = new VideoCFModule();
mVideoCFModule.init(fragment, mUI, mVideoManager);
mVideoCFModule.setmOnMediaListener(fragment);
}
public void startBackPreview() {
mVideoCBModule.startPreview();
}
public void startFrontPreview() {
mVideoCFModule.startPreview();
}
public synchronized void startBackVideoRec() {
mVideoCBModule.startVideoRecording();
}
public synchronized void startFrontVideoRec() {
mVideoCFModule.startVideoRecording();
}
public synchronized void stopBackVideoRec() {
Logger.d("========HomeFragment===1=========" + mVideoCBModule);
mVideoCBModule.stopVideoRecording();
}
public synchronized void stopFrontVideoRec() {
Logger.d("========HomeFragment===2=========" + mVideoCFModule);
mVideoCFModule.stopVideoRecording();
}
public synchronized boolean stopBackVideoRecDelay() {
Logger.d("========HomeFragment===1=========" + mVideoCBModule);
return mVideoCBModule.stopVideoRecordingDelay();
}
public synchronized boolean stopFrontVideoRecDelay() {
Logger.d("========HomeFragment===2=========" + mVideoCFModule);
return mVideoCFModule.stopVideoRecordingDelay();
}
public void destoryBackMediaRec() {
mVideoCBModule.destoryMediaRecoder();
}
public void destoryFrontMediaRec() {
mVideoCFModule.destoryMediaRecoder();
}
public void closeCamera() {
mVideoCBModule.closeCamera();
mVideoCFModule.closeCamera();
}
public void closeBackCamera() {
mVideoCBModule.closeCamera();
}
public synchronized void closeFrontCamera() {
mVideoCFModule.closeCamera();
}
public void closeCheckSpace() {
if (mVideoManager != null) {
mVideoManager.stopThread();
}
}
public synchronized boolean isBackRec() {
return mVideoCBModule.isRecording();
}
public synchronized boolean isFrontRec() {
return mVideoCFModule.isRecording();
}
public boolean isOpenBackCamera() {
return mVideoCBModule.isOpenCamera();
}
public boolean isOpenFrontCamera() {
return mVideoCFModule.isOpenCamera();
}
public VideoManager getmVideoManager() {
return mVideoManager;
}
public void takeBackPhoto() {
if ( isOpenBackCamera() ) {
mVideoCBModule.burstcapture();
}
}
public void takeFrontPhoto() {
if ( isOpenFrontCamera() ) {
mVideoCFModule.burstcapture();
}
}
//主显示的摄像头类型
public void setMainCameraType(int type) {
mCameraType = type;
}
//主显示的摄像头类型
public int getMainCameraType() {
return mCameraType;
}
public void setCbWhiteBalance(int i, boolean auto) {
mVideoCBModule.setWhiteBalance(i, auto);
}
public void setCfWhiteBalance(int i, boolean auto) {
mVideoCFModule.setWhiteBalance(i, auto);
}
public int getAwbParam() {
return mVideoCBModule.getAwbParam();
}
public void setZoom(int i) {
//mVideoCBModule.setZoom(i);
}
public int getZoom() {
return mVideoCBModule.getZoom();
}
public void setBackId(int id) {
BaseModule.FACING_BACK_ID = id;
}
public void setFrontId(int id) {
BaseModule.FACING_FRONT_ID = id;
}
public void setBackCamShow(int visibility) {
mVideoCBModule.setCameraShow(visibility);
}
public void setFrontCamShow(int visibility) {
mVideoCFModule.setCameraShow(visibility);
}
public void setDisplayOrientation() {
mVideoCBModule.setDisplayOrientation();
}
public int getSingleCamSize() {
int ret = 0;
if ( mVideoCBModule != null ) {
ret = CameraUtils.getCamSize(mVideoCBModule.previewSizeWidth, mVideoCBModule.previewSizeHeight);
}
return ret;
}
public void setBackCamZoom() {
mVideoCBModule.setZoom();
}
public void setFrontCamZoom() {
mVideoCFModule.setZoom();
}
/*public void takeIcePhoto(VideoCBModule.OnMediaSavedListener listener) {
if ( isOpenCamera() ) {
mVideoCBModule.burstIcecapture(listener);
}
}*/
}
package com.sw.laryngoscope.camera;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ImageSpan;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.sw.laryngoscope.R;
import com.sw.laryngoscope.activity.fragment.HomeFragment;
import com.sw.laryngoscope.manager.SpManager;
import com.sw.laryngoscope.utils.Logger;
import com.sw.laryngoscope.utils.TimeUtil;
public class VideoUI {
private final HomeFragment fragment;
private final View mRootView;
TextView txt_video_time;
//TextView txt_video_total_time;
ImageView img_record_shortcut;
ImageView img_record_flag;
private boolean mRecordingStarted = false;
public VideoUI(HomeFragment fragment, View parent) {
this.fragment = fragment;
mRootView = parent;
txt_video_time = (TextView) fragment.getView().findViewById(R.id.txt_video_time);
//txt_video_total_time = (TextView) fragment.getView().findViewById(R.id.txt_video_total_time);
img_record_shortcut = (ImageView) fragment.getView().findViewById(R.id.img_record_shortcut);
img_record_flag = (ImageView) fragment.getView().findViewById(R.id.img_record_flag);
}
public void setRecordingTime(String text, String total) {
txt_video_time.setText(text);
//txt_video_total_time.setText(total);
Logger.d("========text=========" + text);
if ( img_record_flag.getVisibility() == View.VISIBLE ) {
img_record_flag.setVisibility(View.GONE);
} else if ( !text.isEmpty() ) {
img_record_flag.setVisibility(View.VISIBLE);
}
}
public void showRecordingUIBack(boolean recording) {
mRecordingStarted = recording;
if (recording) {
txt_video_time.setText("");
txt_video_time.setVisibility(View.VISIBLE);
img_record_shortcut.setSelected(true);
//txt_video_total_time.setText("");
//txt_video_total_time.setVisibility(View.VISIBLE);
} else {
txt_video_time.setText("");
//txt_video_record.setVisibility(View.GONE);
txt_video_time.setVisibility(View.GONE);
img_record_flag.setVisibility(View.GONE);
img_record_shortcut.setSelected(false);
//txt_video_total_time.setText("");
}
}
public SpannableString valueAndIcon(Context context, String str, int resId) {
boolean isLeft = context.getResources().getConfiguration().locale.getLanguage().endsWith("ir");
String res;
if (isLeft) {
res = " " + str;
} else {
res = str + " ";
}
SpannableString sp = new SpannableString(res);
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), resId);
Bitmap newBitmap = alterSizeBitmap(bitmap, 60, 60);
if (newBitmap != null) {
ImageSpan imageSpan = new ImageSpan(context, newBitmap);
if (!isLeft) {
sp.setSpan(imageSpan, res.length() - 1, res.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
} else {
sp.setSpan(imageSpan, 0, 1, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
}
}
return sp;
}
public Bitmap alterSizeBitmap(Bitmap bitmap, int newWidth, int newHeight) {
float scaleWidth = ((float) newWidth) / bitmap.getWidth();
float scaleHeight = ((float) newHeight) / bitmap.getHeight();
Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);
return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
}
}
package com.sw.laryngoscope.common;
import com.sw.laryngoscope.R;
public class Constant {
public static final boolean USB_INPUT_ENABLED = true;
public static final boolean FREEZE_UNFREEZE_ENABLED = true;
public static final boolean AWB_ENABLED = true;
public static final boolean ZOOM_ENABLED = true;
public static final boolean LED_BRIGHTNESS_ENABLED = true;
public static final boolean IMAGE_ADJUSTMENT_DISABLED = false;
public static final boolean SNAPSHOT_ENABLED = true;
public static final boolean RECORDING_ENABLED = true;
public static final boolean ARCHIVE_WITHOUT_LOGIN_ENABLED = false;
public static final int INACTIVITY_LOGOUT_TIME_10 = 0;
public static final int INACTIVITY_LOGOUT_TIME_30 = 1;
public static final int INACTIVITY_LOGOUT_TIME_60 = 2;
public static final int INACTIVITY_LOGOUT_TIME_NEVER = 3;
public final static int[] INACTIVITY_LOGOUT_VALUE = {10 * 60 * 1000, 30 * 60 * 1000,
60 * 60 * 1000,};
public static final int LARYNGOSCOPE_TYPE_8 = 0;
public static final int LARYNGOSCOPE_TYPE_10 = 1;
public static final int BORDER_TYPE_A = 0;
public static final int BORDER_TYPE_B = 1;
public static final int BORDER_TYPE_C = 2;
public static final int BORDER_TYPE_D = 3;
public static final String ISBACKTOSETTING = "isBackToSetting";
public final static int[] UserTypeRes = { R.mipmap.img_admin_user, R.mipmap.img_normal_user, };
public static boolean isWifiOk;
}
package com.sw.laryngoscope.common;
import android.os.Environment;
import com.sw.laryngoscope.R;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import okhttp3.MediaType;
public class InitParam {
public static String IMAGE_FILE_PATH = "images/avatars/";
public static String IMAGE_FILE_NAME_HEAD = "";
public static String IMAGE_FILE_NAME_END = "";
public static String IMAGE_FILE_NAME = "";
public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
public static final String KEY = "ONapikey1000125";
//Root Endpoint:
public static final String BaseUrl = "https://athena.haochezhu.club/cheji/vehicle/third/";//生成环境地址
public static final String post_heartbeat = BaseUrl + "heartbeat";
public static final int MSG_HR = 0x100;
public static final String prefixBack = "VID_B";
public static final String prefixFront = "VID_F";
public static final String prefixPic = "IMG";
public static final String prefixPdf = "P";
public final static int FILE_VIDEO = 1;
public final static int FILE_PHOTO = 2;
public final static int FILE_DOC = 3;
public final static int VIDEO_PREVIEW[][] = { /*{400, 400}, {600, 600},*/ {800, 800}, {1000, 1000}, };
public final static int VIDEO_ONE_PREVIEW[][] = { /*{400, 400}, {600, 600},*/ {800, 800}, {1422, 1048}, };
public final static String zoom_n[] = { /*"ZOOM0", "ZOOM1",*/ "ZOOM0", "ZOOM1", };
public final static int USER_TYPE_ADMIN = 1;//Administrator
public final static int USER_TYPE_USER = 2;//User
public final static int USER_TYPE_GUEST = 3;
public final static int[] USER_TYPE_STR = {R.string.string_administrator, R.string.string_uers, R.string.string_guest,};
public final static int[] USER_TYPE_RES = {R.mipmap.img_login_admin, R.mipmap.img_login_user, R.mipmap.img_login_user,};
public final static String name_guest = "Guest";
public final static int[] LAN_TYPE_RES = { R.string.string_lan_cn, R.string.string_lan_en,
R.string.string_lan_fr, R.string.string_lan_de,
R.string.string_lan_es, R.string.string_lan_pt,
R.string.string_lan_nb, R.string.string_lan_sv,
R.string.string_lan_fi, R.string.string_lan_it,
R.string.string_lan_ru, };
public final static Locale mLocale[] = { Locale.SIMPLIFIED_CHINESE, Locale.ENGLISH,
Locale.FRENCH, Locale.GERMAN,
new Locale("es", "ES"), new Locale("pt", "PT"),
new Locale("nb", "NO"), new Locale("sv", "SE"),
new Locale("fi", "FI"), Locale.ITALIAN,
new Locale("ru", "RU"), };
//public final static List<String, String> zoneList = new ArrayList<>();
public final static List<HashMap<String, Object>> zoneList = new ArrayList<HashMap<String, Object>>();
public final static String ZONE_ID = "id";
public final static String ZONE_COUNTRYNAME = "countryname";
public static final String DOWNLOAD_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/oudi";
public static final String APK_NAME = "Laryngoscope.apk";
public enum SEX_VAL {
MALE,
FEMALE,
BLANK,
}
public final static int[] SEX_VAL_RES = { R.string.string_male, R.string.string_female, R.string.string_blank, };
public static int patientSex = 2;
public enum FILE_TIME_SEL {
/*RECENT,
THIS_WEEK,
THIS_MONTH,*/ THIS_YEAR,
LAST_YEAR,
}
public final static int[] FILE_TIME_RES = { /*R.string.string_recently, R.string.string_this_week, R.string.string_this_month_1,*/
R.string.string_this_year, R.string.string_last_year, };
public enum FOLDER_LEVEL {
L_ONE,
L_TWO,
L_THREE,
}
public static final String pwmPath = "/sys/class/weiken_pwmset/pwmset_enable";
public static final int CAM_BACK = 1;//主摄像头标识
public static final int CAM_FRONT = 2;//次摄像头标识
public static final int CAM_OV6946 = 0;//可能出现0 和1
public static final int CAM_TYPE_C = 2;//可能出现2 或者 1
public static final int CAM_OV9734 = 1;//可能出现1
public enum CAM_VALUE {
NON, OV6946, OV9734,
TYPEC1, TYPEC2,
OV6946_TYPEC1,
OV9734_TYPEC1,
OV6946_TYPEC2,
OV9734_TYPEC2,
}
public final static int[] CAMERA_STATUS_RES = { R.mipmap.img_status_ice, R.mipmap.img_status_awb,
R.mipmap.img_status_enlarge, R.mipmap.img_status_record,
R.mipmap.img_status_photo, };
public final static boolean[] handleOneKey = {false, false, false, false, false, };
public final static boolean[] handleTwoKey = {false, false, false, false, false, };
public final static int[] CAMERA_KEY_RES = { R.mipmap.img_main_awb_1, R.mipmap.img_main_amplify_1,
R.mipmap.img_main_camera_1, R.mipmap.img_main_photo_1,
R.mipmap.img_main_ice_1, };
/*
F1 为白平衡按键
F2 为冻结按键 冻结按键定义为拍照保存并停止在当前画面
F3 金手指接口拍照或者录像按键
F4 typec1接口拍照或者录像按键
F5 typec2接口拍照或者录像按键
摄像头识别由读取节点/sys/class/weiken_adc_keydet/camera_model
内容确定,读出值与摄像头对应关系如下:
0 无摄像头
1 摄像头OV6946
2 摄像头OV9734
3 typec1 USBcamera
4 typec2 USBcamera
5 摄像头OV6946 + typec1 USBcamera
6 摄像头OV9734 + typec1 USBcamera
7 摄像头OV6946 + typec2 USBcamera
8 摄像头OV9734 + typec2 USBcamera*/
}
package com.sw.laryngoscope.db;
import org.litepal.annotation.Column;
import org.litepal.crud.LitePalSupport;
public class AccountInfoDB extends LitePalSupport {
/*private int id;
private String account_no = "";
private String account = "";*/
@Column(unique = true)
//@SerializedName(value = "id")
private int id;
private String name = "";
private String password = "";
private int userType = 0;//Administrator//Advanced user//User
private int isSelect = 0;
private boolean isLogin = false;
public AccountInfoDB() {
}
public AccountInfoDB(String name, String password, int type) {
this.name = name;
this.password = password;
this.userType = type;
}
public AccountInfoDB(int id, String name, String password, int userType, int isSelect, boolean isLogin) {
this.id = id;
this.name = name;
this.password = password;
this.userType = userType;
this.isSelect = isSelect;
this.isLogin = isLogin;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getUserType() {
return userType;
}
public void setUserType(int type) {
this.userType = type;
}
public int getIsSelect() {
return isSelect;
}
public void setIsSelect(int isSelect) {
this.isSelect = isSelect;
}
public boolean isLogin() {
return isLogin;
}
public void setLogin(boolean login) {
isLogin = login;
}
public int getId() {
return id;
}
@Override
public String toString() {
return "AccountInfoDB{" +
"id=" + id +
", name='" + name + '\'' +
", password='" + password + '\'' +
", userType=" + userType +
", isSelect=" + isSelect +
", isLogin=" + isLogin +
'}';
}
}
package com.sw.laryngoscope.db;
public class DeviceInfoBean /*implements Serializable*/ {
public String txt_cap;
public String txt_value;
public DeviceInfoBean(String txt_cap, String txt_value) {
this.txt_cap = txt_cap;
this.txt_value = txt_value;
}
public String getTxt_cap() {
return txt_cap;
}
public void setTxt_cap(String txt_cap) {
this.txt_cap = txt_cap;
}
public String getTxt_value() {
return txt_value;
}
public void setTxt_value(String txt_value) {
this.txt_value = txt_value;
}
}
package com.sw.laryngoscope.db;
import java.io.Serializable;
public class FileDayBean implements Serializable {
public String itemName;
public String itemTime;
public int itemFileNum;
public String note;
public boolean isCheck;
public String itemDay;
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public String getItemTime() {
return itemTime;
}
public void setItemTime(String itemTime) {
this.itemTime = itemTime;
}
public int getItemFileNum() {
return itemFileNum;
}
public void setItemFileNum(int itemFileNum) {
this.itemFileNum = itemFileNum;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public boolean isCheck() {
return isCheck;
}
public void setCheck(boolean check) {
isCheck = check;
}
public String getItemDay() {
return itemDay;
}
public void setItemDay(String itemDay) {
this.itemDay = itemDay;
}
}
package com.sw.laryngoscope.db;
import java.io.Serializable;
import java.util.List;
public class FileInfoMonthBean implements Serializable {
public String rvName;
public boolean isAllCheck;
public List<FileDayBean> fileItemList;
public FileInfoMonthBean() {
}
public String getRvName() {
return rvName;
}
public void setRvName(String rvName) {
this.rvName = rvName;
}
public boolean isAllCheck() {
return isAllCheck;
}
public void setAllCheck(boolean allCheck) {
isAllCheck = allCheck;
}
public List<FileDayBean> getFileItemList() {
return fileItemList;
}
public void setFileItemList(List<FileDayBean> fileItemList) {
this.fileItemList = fileItemList;
}
}
package com.sw.laryngoscope.db;
import java.io.Serializable;
public class FolderItemBean implements Serializable {
public String fdName;
public String startTimestamp;
public String listMonth;//2021-03
public String listYear;//2021
public boolean isReport;
public FolderItemBean() {
}
public String getFdName() {
return fdName;
}
public void setFdName(String fdName) {
this.fdName = fdName;
}
public String getStartTimestamp() {
return startTimestamp;
}
public void setStartTimestamp(String startTimestamp) {
this.startTimestamp = startTimestamp;
}
public String getListMonth() {
return listMonth;
}
public void setListMonth(String listMonth) {
this.listMonth = listMonth;
}
public String getListYear() {
return listYear;
}
public void setListYear(String listYear) {
this.listYear = listYear;
}
public boolean isReport() {
return isReport;
}
public void setReport(boolean report) {
isReport = report;
}
}
package com.sw.laryngoscope.db;
public class MBean {
public void getItemName() {
new Thread(new Runnable() {
@Override
public void run() {
try {
//----------
//----------
} catch (Exception e) {
}
}
}).start();
}
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This file is too large to display.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This file is too large to display.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This file is too large to display.
This file is too large to display.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.