1. 新增问题和删除修改功能(调试中)
2. 轨迹记录功能开放为所有类型的场景都记录
| | |
| | | android:theme="@style/AppTheme.NoActionBar" /> |
| | | <activity android:name=".module.inspection.MenuEvidenceActivity" |
| | | android:theme="@style/TransparentTheme" /> |
| | | <activity android:name=".module.inspection.MenuProblemUpdateActivity" |
| | | android:theme="@style/TransparentTheme" /> |
| | | <activity android:name=".module.inspection.MenuRecheckActivity" |
| | | android:theme="@style/TransparentTheme" /> |
| | | <activity android:name=".module.inspection.MenuProblemListActivity" |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.bean.vo |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/7/30 |
| | | */ |
| | | data class ProblemDetailVo( |
| | | var problemTypeName: String, |
| | | var problems: List<String> |
| | | ) |
| | |
| | | * @author riku |
| | | * Date: 2019/5/16 |
| | | */ |
| | | class DbFactory private constructor(application: CommonApplication){ |
| | | class DbFactory private constructor(private val application: CommonApplication){ |
| | | |
| | | private var daoSession: DaoSession? = null |
| | | |
| | | init { |
| | | daoSession = application.daoSession |
| | | } |
| | | |
| | | companion object { |
| | | |
| | | @Volatile |
| | | private lateinit var daoSession: DaoSession |
| | | private var mDbFactory: DbFactory? = null |
| | | |
| | | //æ°æ®åºåå§å |
| | | @JvmStatic |
| | | @Synchronized |
| | | fun init(application: CommonApplication) { |
| | | daoSession = application.daoSession |
| | | if (mDbFactory == null) { |
| | | mDbFactory = DbFactory(application) |
| | | } |
| | | } |
| | | |
| | | //è·åæ°æ®åºæä½å¯¹è±¡daoSession |
| | | fun getGreenDaoObservable(): Observable<DaoSession> { |
| | | return Observable.create { emitter -> |
| | | daoSession.let { |
| | | mDbFactory?.daoSession?.let { |
| | | emitter.onNext(it) |
| | | emitter.onComplete() |
| | | } |
| | |
| | | } |
| | | |
| | | fun getInstance(): DaoSession { |
| | | return daoSession |
| | | if (mDbFactory == null) { |
| | | mDbFactory = DbFactory(CommonApplication.getInstance()) |
| | | } |
| | | return mDbFactory!!.daoSession!! |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.common.net |
| | | |
| | | import okhttp3.Interceptor |
| | | import okhttp3.Response |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/4/24 |
| | | */ |
| | | class NetWorkProgressInterceptor(private val netWorkProgressListener: NetWorkProgressListener) : Interceptor { |
| | | override fun intercept(chain: Interceptor.Chain): Response { |
| | | val request = chain.request() |
| | | if (request.body() == null) { |
| | | return chain.proceed(request) |
| | | } |
| | | val b = request.newBuilder() |
| | | .method( |
| | | request.method(), |
| | | ProgressRequestBody(request.body(), netWorkProgressListener)) |
| | | .build() |
| | | return chain.proceed(b) |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.common.net |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/4/24 |
| | | * ä¸ä¼ ãä¸è½½è¿åº¦ç嬿¥å£ |
| | | */ |
| | | interface NetWorkProgressListener { |
| | | fun onProgress(progress: Long, total: Long) |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.common.net |
| | | |
| | | import cn.flightfeather.thirdapp.common.net.NetWorkProgressListener |
| | | import okhttp3.MediaType |
| | | import okhttp3.RequestBody |
| | | import okio.* |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/4/24 |
| | | * 带è¿åº¦åè°çRequestBody |
| | | */ |
| | | class ProgressRequestBody( |
| | | private val mRequestBody: RequestBody?, |
| | | private val netWorkProgressListener: NetWorkProgressListener |
| | | ) : RequestBody() { |
| | | |
| | | override fun contentType(): MediaType? = mRequestBody?.contentType() |
| | | |
| | | override fun contentLength(): Long = mRequestBody?.contentLength() ?: super.contentLength() |
| | | |
| | | override fun writeTo(sink: BufferedSink) { |
| | | val progressSink = ProgressSink(sink) |
| | | val newSink = Okio.buffer(progressSink) |
| | | mRequestBody?.writeTo(newSink) |
| | | newSink.flush() |
| | | } |
| | | |
| | | inner class ProgressSink(delegate: Sink) : ForwardingSink(delegate) { |
| | | private var bytesWritten = 0L |
| | | |
| | | override fun write(source: Buffer, byteCount: Long) { |
| | | super.write(source, byteCount) |
| | | bytesWritten += byteCount |
| | | netWorkProgressListener.onProgress(bytesWritten, contentLength()) |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.common.net |
| | | |
| | | import retrofit2.Call |
| | | import retrofit2.Callback |
| | | import retrofit2.Response |
| | | import cn.flightfeather.thirdapp.model.bean.BaseResponse |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/8/4 |
| | | * ç¸æ¯äº[ResponseBodyCallBack], å°è¿åç»æç¨[BaseResponse]è¿è¡ç»ä¸å
è£
|
| | | */ |
| | | class ResponseBodyCallBack2<T>(private val resultCallBack: ResultCallBack2<T>?) : Callback<BaseResponse<T>> { |
| | | override fun onFailure(p0: Call<BaseResponse<T>>, p1: Throwable) { |
| | | resultCallBack?.onFailure("ç½ç»è¿æ¥é误ï¼è¯·æ£æ¥ç½ç»") |
| | | } |
| | | |
| | | override fun onResponse(p0: Call<BaseResponse<T>>, p1: Response<BaseResponse<T>>) { |
| | | if (p1.isSuccessful && p1.body()?.success == true) { |
| | | resultCallBack?.onSuccess(p1.body()?.data, p1.body()?.message ?: "") |
| | | } else { |
| | | resultCallBack?.onFailure(p1.body()?.message ?: "") |
| | | } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.common.net |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2019/4/24 |
| | | * æ°æ®è·åç»æåè° |
| | | * MVVM模å¼ä¸ï¼æ°æ®ä»åºï¼repositoryï¼ç®¡çææçæ°æ®è·åå
·ä½å®ç°ï¼æä¾æ¤æ¥å£æ¥å®ç°æ°æ®è·ååæ¥éª¤ä¸çæ¹æ³åè° |
| | | */ |
| | | interface ResultCallBack2<T> { |
| | | |
| | | /** |
| | | * å页信æ¯è·å |
| | | * @param current å½å页ç ï¼æå°ä¸º1ï¼ |
| | | * @param total æ»é¡µæ° |
| | | */ |
| | | fun onPage(current: Int, total: Int) = Unit |
| | | |
| | | fun onSuccess(result: T?, message: String) |
| | | |
| | | fun onCacheSuccess(result: T?) = Unit |
| | | |
| | | fun onFailure(message:String) |
| | | |
| | | } |
| | |
| | | package cn.flightfeather.thirdapp.common.net |
| | | |
| | | import cn.flightfeather.thirdapp.BuildConfig |
| | | import cn.flightfeather.thirdapp.CommonApplication |
| | | import com.google.gson.GsonBuilder |
| | | import io.reactivex.Observable |
| | | import io.reactivex.android.schedulers.AndroidSchedulers |
| | | import io.reactivex.schedulers.Schedulers |
| | | import okhttp3.Interceptor |
| | | import okhttp3.OkHttpClient |
| | | import retrofit2.Response |
| | | import retrofit2.Retrofit |
| | | import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory |
| | | import retrofit2.converter.gson.GsonConverterFactory |
| | | import java.util.concurrent.TimeUnit |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2019/7/22 |
| | | * ç½ç»è¯·æ± |
| | | */ |
| | | class RetrofitFactory constructor(application: CommonApplication){ |
| | | class RetrofitFactory constructor(val application: CommonApplication){ |
| | | |
| | | val retrofit: Retrofit = application.retrofit |
| | | val retrofitImage: Retrofit = application.retrofitImage |
| | | |
| | | private fun newOkHttpClient(list: List<Interceptor>): OkHttpClient = |
| | | OkHttpClient.Builder() |
| | | .connectTimeout(20 * 1000L, TimeUnit.MILLISECONDS) |
| | | .apply { |
| | | list.forEach { |
| | | addInterceptor(it) |
| | | } |
| | | } |
| | | .build() |
| | | |
| | | private fun newRetrofit(mOkHttpClient: OkHttpClient): Retrofit = |
| | | Retrofit.Builder() |
| | | .apply { |
| | | baseUrl(application.ROOT_URL_RELEASE) |
| | | } |
| | | .addConverterFactory( |
| | | GsonConverterFactory.create( |
| | | GsonBuilder() |
| | | .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") |
| | | .create() |
| | | ) |
| | | ) |
| | | .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) |
| | | .client(mOkHttpClient) |
| | | .build() |
| | | |
| | | companion object { |
| | | |
| | |
| | | .observeOn(AndroidSchedulers.mainThread()) |
| | | .subscribe(subscriber) |
| | | } |
| | | |
| | | fun withProgressListeningRetrofit(listener: NetWorkProgressListener?): Retrofit { |
| | | return if (listener == null) { |
| | | instance.retrofit |
| | | } else { |
| | | val c = instance.newOkHttpClient(listOf(NetWorkProgressInterceptor(listener))) |
| | | instance.newRetrofit(c) |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.httpservice |
| | | |
| | | import okhttp3.ResponseBody |
| | | import retrofit2.Call |
| | | import retrofit2.http.DELETE |
| | | import retrofit2.http.GET |
| | | import retrofit2.http.Path |
| | | import retrofit2.http.Url |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/8/6 |
| | | */ |
| | | interface MediaFileService { |
| | | @GET |
| | | fun downloadImage(@Url fileUrl: String): Call<ResponseBody> |
| | | |
| | | @DELETE("mediafile/{MediaFileGUID}/ ") |
| | | fun deleteMediaFile(@Path("MediaFileGUID") mediaFileGuid: String): Call<ResponseBody> |
| | | } |
| | |
| | | package cn.flightfeather.thirdapp.httpservice; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import cn.flightfeather.thirdapp.bean.vo.AreaVo; |
| | | import cn.flightfeather.thirdapp.bean.vo.ChargeInfoVo; |
| | | import cn.flightfeather.thirdapp.bean.vo.ProblemDetailVo; |
| | | import cn.flightfeather.thirdapp.bean.vo.ProblemlistVo; |
| | | import cn.flightfeather.thirdapp.bean.vo.StatisticsVo; |
| | | import cn.flightfeather.thirdapp.model.bean.BaseResponse; |
| | | import io.reactivex.Observable; |
| | | import okhttp3.ResponseBody; |
| | | import retrofit2.Call; |
| | | import retrofit2.Response; |
| | | import retrofit2.http.Body; |
| | | import retrofit2.http.Field; |
| | | import retrofit2.http.FormUrlEncoded; |
| | | import retrofit2.http.GET; |
| | | import retrofit2.http.POST; |
| | | import retrofit2.http.Path; |
| | | import retrofit2.http.Query; |
| | | |
| | | /** |
| | |
| | | //æ´æ°é®é¢ |
| | | @POST("problemlist/") |
| | | Call<ResponseBody> updateProblemList(@Body ProblemlistVo problemlistVo); |
| | | |
| | | @GET("problemtype/byScene") |
| | | Observable<Response<ArrayList<ProblemDetailVo>>> getBySceneType(@Query("sceneTypeId") int sceneTypeId); |
| | | |
| | | /** |
| | | * 设置é®é¢ä¸ºå é¤ç¶æ |
| | | */ |
| | | @POST("problemlist/{id}") |
| | | Call<BaseResponse<Integer>> deleteProblem(@Path("id") String problemId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.model.bean |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/8/4 |
| | | * ç½ç»è¯·æ±è¿åæ°æ®åºç±» |
| | | */ |
| | | data class BaseResponse<T>( |
| | | val success: Boolean, |
| | | val message: String, |
| | | val data: T? |
| | | ) |
| | |
| | | package cn.flightfeather.thirdapp.module.base |
| | | |
| | | import android.annotation.SuppressLint |
| | | import android.content.Context |
| | | import android.content.Intent |
| | | import android.content.pm.ActivityInfo |
| | | import android.os.Bundle |
| | | import android.support.v4.app.Fragment |
| | | import android.support.v4.app.FragmentManager |
| | |
| | | |
| | | protected val disposableList = mutableListOf<Disposable>() |
| | | |
| | | @SuppressLint("SourceLockedOrientationActivity") |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | | try { |
| | | requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT |
| | | } catch (e: Exception) { |
| | | e.printStackTrace() |
| | | } |
| | | setContentView(getLayoutId()) |
| | | rootView = findViewById<ViewGroup>(android.R.id.content).getChildAt(0) as ViewGroup |
| | | } |
| | |
| | | const val EXTRA_SELECT_IMAGES = ImagePicker.EXTRA_SELECT_IMAGES |
| | | } |
| | | |
| | | //ææçå¾
ä¸ä¼ çå¾çæä»¶å表 |
| | | val pathTempList = mutableListOf<File>() |
| | | //ææçå¾
ä¸ä¼ çå¾çæä»¶å表, true: 代表éè¦ä¸ä¼ ï¼false: 代表ä¸éè¦ä¸ä¼ |
| | | val pathTempList = mutableListOf<Pair<File, Boolean>>() |
| | | |
| | | // fixme: 2019/8/2 ç±äºå代ç ä¸å¤§é¨åå¾çææåºå®æ»äºæå¤3å¼ ï¼æä»¥æ²¡æä½¿ç¨åè¡¨ç»æï¼èæ¯æå¨è®¾ç½®äº3个ImageViewï¼æ¤å¤ææ¶å»¶ç¨ï¼ä¸åä¿®æ¹ |
| | | var imageViewList = mutableListOf<ImageView>() |
| | |
| | | //æ¥çä¸´æ¶ææå¾çå¯ä»¥å é¤ |
| | | data?.getIntExtra("position", -1)?.let { |
| | | if (it > -1) { |
| | | if (pathTempList[it].exists()) { |
| | | pathTempList[it].delete() |
| | | if (pathTempList[it].first.exists()) { |
| | | pathTempList[it].first.delete() |
| | | } |
| | | pathTempList.removeAt(it) |
| | | refreshImageView() |
| | |
| | | } |
| | | try { |
| | | FileUtil.copyFile(oldFile, newFile) |
| | | pathTempList.add(newFile) |
| | | pathTempList.add(Pair(newFile, true)) |
| | | } catch (e: IOException) { |
| | | e.printStackTrace() |
| | | application.toast("å¤å¶æä»¶å¤±è´¥") |
| | |
| | | i < picSize -> { |
| | | imageViewList[i].setOnClickListener(viewPhotoClickListener(i)) |
| | | // fixme: 2019/8/2 æ¤å¤ç»imageVIew设置å¾çå¨å代ç 䏿¯èªå®ä¹äºä¸ä¸ªAsyncTaskï¼ä¹åå¯ä»¥ç¨Glideçç¬¬ä¸æ¹æ¡æ¶æ¿ä»£ |
| | | SetImageTask(pathTempList[i], imageViewList[i]).execute() |
| | | imageViewList[i].scaleType = ImageView.ScaleType.CENTER_CROP |
| | | SetImageTask(pathTempList[i].first, imageViewList[i]).execute() |
| | | } |
| | | i == picSize -> imageViewList[i].run { |
| | | setOnClickListener(takePhotoClickListener(i)) |
| | | scaleType = ImageView.ScaleType.FIT_CENTER |
| | | setImageResource(R.drawable.icon_add_photo) |
| | | } |
| | | else -> imageViewList[i].run { |
| | | setOnClickListener(null) |
| | | scaleType = ImageView.ScaleType.FIT_CENTER |
| | | setImageResource(R.drawable.icon_add_photo_blank) |
| | | } |
| | | } |
| | |
| | | //æå¾çæ¶ï¼æ¥çå¾ççç¹å»äºä»¶(temp) |
| | | fun viewPhotoClickListener(position: Int): View.OnClickListener { |
| | | return View.OnClickListener { |
| | | val fileList = mutableListOf<File>() |
| | | pathTempList.forEach { |
| | | fileList.add(it.first) |
| | | } |
| | | val intent = Intent(this, PhotoViewerActivity::class.java) |
| | | intent.putExtra("position", position) |
| | | intent.putExtra("type", PhotoViewerActivity.EVIDENCE_PHOTO_TEMP) |
| | | intent.putExtra("deletable", picDeletable) |
| | | intent.putExtra(PhotoViewerActivity.PARA_FILES, pathTempList as Serializable) |
| | | intent.putExtra(PhotoViewerActivity.PARA_FILES, fileList as Serializable) |
| | | startActivityForResult(intent, VIEW_PHOTO) |
| | | } |
| | | } |
| | |
| | | return View.OnClickListener { |
| | | val t = imageViewList.size - pathTempList.size |
| | | val picNum = if (t >= 0) t else 0 |
| | | PhotoUtil.pickPhoto2(this, TAKE_PHOTO, picNum) |
| | | PhotoUtil.pickPhoto(this, TAKE_PHOTO, picNum) |
| | | } |
| | | } |
| | | |
| | |
| | | private fun initLocation() { |
| | | locationUtil = LocationUtil(this) |
| | | locationUtil.startLocation { |
| | | val date = Date(it.time) |
| | | val date = Date() |
| | | val time = DateFormatter.dateTimeFormat3.format(date) |
| | | val locationInfo = "ç»åº¦: ${it.longitude}" + |
| | | "\n纬度: ${it.latitude}" + |
| | |
| | | import cn.flightfeather.thirdapp.adapter.ProblemListAdapter |
| | | import cn.flightfeather.thirdapp.adapter.RecyclerItemClickListener |
| | | import cn.flightfeather.thirdapp.bean.Inspection |
| | | import cn.flightfeather.thirdapp.bean.Scense |
| | | import cn.flightfeather.thirdapp.bean.Subtask |
| | | import cn.flightfeather.thirdapp.model.event.ProblemEvent |
| | | import cn.flightfeather.thirdapp.module.base.BaseActivity |
| | | import kotlinx.android.synthetic.main.dialog_problem_list.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.greenrobot.eventbus.Subscribe |
| | | |
| | | /** |
| | | * @author riku |
| | |
| | | */ |
| | | abstract var type: Int |
| | | |
| | | var subTaskSelected: Subtask? = null |
| | | var inspection: Inspection? = null |
| | | var lat: Double = 0.0 |
| | | var lng: Double = 0.0 |
| | | protected var subTaskSelected: Subtask? = null |
| | | protected var inspection: Inspection? = null |
| | | protected var scene: Scense? = null |
| | | protected var lat: Double = 0.0 |
| | | protected var lng: Double = 0.0 |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | | EventBus.getDefault().register(this) |
| | | |
| | | viewModel = ViewModelProviders.of(this).get(BaseProblemListViewModel::class.java) |
| | | |
| | | subTaskSelected = intent.getSerializableExtra("subTask") as Subtask? |
| | | inspection = intent.getSerializableExtra("inspection") as Inspection? |
| | | scene = intent.getSerializableExtra("scene") as Scense? |
| | | lat = intent.getDoubleExtra("lat", 0.0) |
| | | lng = intent.getDoubleExtra("lng", 0.0) |
| | | |
| | |
| | | } |
| | | |
| | | override fun onItemLongClick(view: View?, position: Int) { |
| | | onItemViewLongClick(view, position) |
| | | } |
| | | |
| | | })) |
| | |
| | | |
| | | tv_title.text = when (type) { |
| | | InspectionDetailActivity.PROBLEM_LIST -> "é®é¢æ¸
å" |
| | | InspectionDetailActivity.PROBLEM_CHECK -> "é®é¢å®¡æ ¸" |
| | | InspectionDetailActivity.CHANGE_CHECK -> "æ´æ¹å®¡æ ¸" |
| | | InspectionDetailActivity.PROBLEM_CHANGE -> "ç°åºæ´æ¹" |
| | | InspectionDetailActivity.PROBLEM_RECHECK -> "é®é¢å¤æ ¸" |
| | | InspectionDetailActivity.PROBLEM_CHECK -> "é®é¢å®¡æ ¸" |
| | | InspectionDetailActivity.CHANGE_CHECK -> "æ´æ¹å®¡æ ¸" |
| | | else -> "" |
| | | } |
| | | |
| | |
| | | finish() |
| | | } |
| | | } |
| | | |
| | | open fun onItemViewLongClick(view: View?, position: Int) { |
| | | |
| | | } |
| | | |
| | | @Subscribe |
| | | fun onPutProblem(problemEvent: ProblemEvent) { |
| | | viewModel.getProblems(inspection?.guid) |
| | | } |
| | | } |
| | |
| | | import cn.flightfeather.thirdapp.bean.Subtask |
| | | import cn.flightfeather.thirdapp.bean.vo.ProblemlistVo |
| | | import cn.flightfeather.thirdapp.common.net.ResultCallBack |
| | | import cn.flightfeather.thirdapp.common.net.ResultCallBack2 |
| | | import cn.flightfeather.thirdapp.model.event.ProblemEvent |
| | | import cn.flightfeather.thirdapp.module.base.BaseViewModel |
| | | import cn.flightfeather.thirdapp.repository.InspectionRepository |
| | | import cn.flightfeather.thirdapp.repository.ProblemRepository |
| | | import cn.flightfeather.thirdapp.util.DateFormatter |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.toast |
| | | |
| | | /** |
| | | * @author riku |
| | |
| | | class BaseProblemListViewModel : BaseViewModel() { |
| | | |
| | | private val inspectionRepository = InspectionRepository() |
| | | private val problemRepository = ProblemRepository() |
| | | |
| | | var problemList = MutableLiveData<ArrayList<ProblemlistVo>>().apply { value = ArrayList() } |
| | | |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å é¤é®é¢ |
| | | */ |
| | | fun deleteProblem(position: Int, s: () -> Unit) { |
| | | problemList.value?.get(position)?.let { |
| | | problemRepository.deleteProblem(it.guid ?: "", object : ResultCallBack2<Int> { |
| | | override fun onSuccess(result: Int?, message: String) { |
| | | if (result != null) { |
| | | EventBus.getDefault().post(ProblemEvent(it.voToEntity(), InspectionDetailActivity.PROBLEM_DELETE)) |
| | | s() |
| | | } |
| | | } |
| | | |
| | | override fun onFailure(message: String) { |
| | | application.toast(message) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | const val PROBLEM_RECHECK = 102//é®é¢å¤æ ¸ |
| | | const val PROBLEM_CHECK = 103//é®é¢å®¡æ ¸ |
| | | const val CHANGE_CHECK = 104//æ´æ¹å®¡æ ¸ |
| | | const val PROBLEM_DELETE = 105 |
| | | } |
| | | |
| | | private var taskStatus: String = Domain.TASK_STATUS_FINISHED |
| | | |
| | | /** |
| | | * å è½½å®æç¶æï¼ |
| | |
| | | iv_patrol_back.setOnClickListener(this) |
| | | ll_patrol_task_detail.visibility = View.GONE |
| | | |
| | | hideMenu() |
| | | |
| | | viewModel.inspection.observe(this, Observer { |
| | | it?.apply { |
| | | showMenu() |
| | | if (extension1 != null) { |
| | | val list = extension1.split(";").map{str -> |
| | | str.split(",").map {str2 -> |
| | |
| | | viewModel.subTask.observe(this, Observer { |
| | | it?.let { |
| | | updateUIBySubTask(it) |
| | | refreshMenuStatus(it.status) |
| | | taskStatus = it.status |
| | | onDataLoaded(1) |
| | | } |
| | | }) |
| | |
| | | result = result.and(it) |
| | | } |
| | | if (result) { |
| | | menuList.forEach { |
| | | it.setOnClickListener(this) |
| | | } |
| | | showMenu() |
| | | refreshMenuStatus(taskStatus) |
| | | } else { |
| | | toast("请çå¾
æ°æ®å è½½å®æ") |
| | | } |
| | |
| | | val address = s.cityname + s.districtname + " " + s.location |
| | | tv_scense_address.text = address |
| | | |
| | | val contact1 = s.contacts + " " + s.contactst |
| | | val contact1 = s.contacts ?: "" + " " + s.contactst ?: "" |
| | | tv_scense_contact1.text = contact1 |
| | | tv_call_contact1.setOnClickListener { |
| | | //æçµè¯ |
| | |
| | | } |
| | | |
| | | private fun startTracking() { |
| | | if (viewModel.scene.value?.typeid?.toString() != Constant.SCENE_TYPE9 |
| | | || viewModel.subTask.value?.status != Domain.TASK_STATUS_RUNNING) return |
| | | if ( |
| | | // viewModel.scene.value?.typeid?.toString() != Constant.SCENE_TYPE9 || |
| | | viewModel.subTask.value?.status != Domain.TASK_STATUS_RUNNING |
| | | ) return |
| | | |
| | | //å½ç»§ç»æ§è¡æ£å¨è¿è¡ä¸ç任塿¶ï¼æ ¹æ®æ¯å¦æåå²è½¨è¿¹è®°å½æ¥å¤ææ¯å¦å¼å¯ |
| | | if (viewModel.inspection.value?.extension1 != null) { |
| | |
| | | val intent = Intent(this, MenuProblemListActivity::class.java).apply { |
| | | putExtra("subTask", viewModel.subTask.value) |
| | | putExtra("inspection", viewModel.inspection.value) |
| | | putExtra("scenseLat", viewModel.scene.value?.latitude) |
| | | putExtra("scenseLng", viewModel.scene.value?.longitude) |
| | | putExtra("scene", viewModel.scene.value) |
| | | putExtra("lat", viewModel.scene.value?.latitude) |
| | | putExtra("lng", viewModel.scene.value?.longitude) |
| | | } |
| | | startActivity(intent) |
| | | } |
| | |
| | | val intent = Intent(this, MenuChangeActivity::class.java).apply { |
| | | putExtra("subTask", viewModel.subTask.value) |
| | | putExtra("inspection", viewModel.inspection.value) |
| | | putExtra("scenseLat", viewModel.scene.value?.latitude) |
| | | putExtra("scenseLng", viewModel.scene.value?.longitude) |
| | | putExtra("lat", viewModel.scene.value?.latitude) |
| | | putExtra("lng", viewModel.scene.value?.longitude) |
| | | } |
| | | startActivity(intent) |
| | | } |
| | |
| | | } |
| | | startActivity(intent) |
| | | } |
| | | //é®é¢å®¡æ ¸ |
| | | //æ´æ¹å®¡æ ¸ |
| | | R.id.ln_patrol_change_check -> { |
| | | val intent = Intent(this, MenuChangeCheckActivity::class.java).apply { |
| | | putExtra("subTask", viewModel.subTask.value) |
| | |
| | | |
| | | @Subscribe(threadMode = ThreadMode.BACKGROUND) |
| | | fun onUpdateChange(problemEvent: ProblemEvent) { |
| | | if (problemEvent.type == InspectionFragment.PROBLEM_CHANGE) { |
| | | if (problemEvent.type == InspectionDetailActivity.PROBLEM_CHANGE) { |
| | | inspection?.apply { |
| | | changednum = changednum?.plus(1) ?: 1 |
| | | |
| | |
| | | import java.io.IOException |
| | | import java.util.* |
| | | |
| | | class MenuEvidenceActivity : BaseTakePicActivity() { |
| | | open class MenuEvidenceActivity : BaseTakePicActivity() { |
| | | |
| | | override fun getLayoutId(): Int = R.layout.dialog_take_evidence |
| | | |
| | | override fun getImageViews(): MutableList<ImageView> |
| | | = mutableListOf(iv_take_evidence_add_photo1, iv_take_evidence_add_photo2, iv_take_evidence_add_photo3) |
| | | override fun getImageViews(): MutableList<ImageView> = mutableListOf(iv_take_evidence_add_photo1, iv_take_evidence_add_photo2, iv_take_evidence_add_photo3) |
| | | |
| | | override val picDeletable: Boolean = true |
| | | |
| | |
| | | var lat = 0.0 |
| | | var lng = 0.0 |
| | | |
| | | protected var submitTime = 0L//æäº¤æ¶é´ï¼é²æ¢è¿ç»æäº¤ï¼å¤æ¬¡è®°å½ |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | |
| | | |
| | | viewModel = ViewModelProviders.of(this).get(MenuEvidenceViewModel::class.java) |
| | | |
| | | subTask = intent.getSerializableExtra("subTask") as Subtask? |
| | | inspection = intent.getSerializableExtra("inspection") as Inspection? |
| | | scene = intent.getSerializableExtra("scene") as Scense? |
| | | lat = intent.getDoubleExtra("lat", 0.0) |
| | | lng = intent.getDoubleExtra("lng", 0.0) |
| | | |
| | | |
| | | getExtra() |
| | | initUI() |
| | | |
| | | viewModel.locationList.observe(this, Observer { |
| | | it?.let { |
| | | sp_take_evidence_select_location.adapter = DomainItemListAdapter(it, this) |
| | | } |
| | | }) |
| | | |
| | | viewModel.problemFatherType.observe(this, Observer { |
| | | it?.let { |
| | | sp_take_evidence_select_problem_type.adapter = ArrayAdapter(this, R.layout.item_spinner_drop_down, it) |
| | | } |
| | | }) |
| | | |
| | | viewModel.problemType.observe(this, Observer { |
| | | it?.let { |
| | | sp_take_evidence_select_problem.adapter = ProblemTypeListAdapter(it, this) |
| | | } |
| | | }) |
| | | |
| | | viewModel.suggestionList.observe(this, Observer { |
| | | it.let { |
| | | sp_take_evidence_select_suggestion.adapter = ArrayAdapter(this, R.layout.item_spinner_drop_down, it) |
| | | } |
| | | }) |
| | | initObserver() |
| | | |
| | | viewModel.getLocationList() |
| | | subTask?.let {t -> |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | open fun getExtra() { |
| | | subTask = intent.getSerializableExtra("subTask") as Subtask? |
| | | inspection = intent.getSerializableExtra("inspection") as Inspection? |
| | | scene = intent.getSerializableExtra("scene") as Scense? |
| | | lat = intent.getDoubleExtra("lat", 0.0) |
| | | lng = intent.getDoubleExtra("lng", 0.0) |
| | | } |
| | | |
| | | private fun initUI() { |
| | |
| | | } |
| | | |
| | | fab_take_evidence_ok.setOnClickListener { |
| | | it.isClickable = false |
| | | val now = Date() |
| | | if (now.time - submitTime >= 1000) { |
| | | submitTime = now.time |
| | | putProblem() |
| | | } |
| | | } |
| | | |
| | | fab_take_evidence_close.setOnClickListener { |
| | |
| | | } |
| | | } |
| | | |
| | | private fun updateUIByProblemType(visible: Int) { |
| | | open fun initObserver() { |
| | | viewModel.locationList.observe(this, Observer { |
| | | it?.let { |
| | | sp_take_evidence_select_location.adapter = DomainItemListAdapter(it, this) |
| | | } |
| | | }) |
| | | |
| | | viewModel.problemFatherType.observe(this, Observer { |
| | | it?.let { |
| | | sp_take_evidence_select_problem_type.adapter = ArrayAdapter(this, R.layout.item_spinner_drop_down, it) |
| | | } |
| | | }) |
| | | |
| | | viewModel.problemType.observe(this, Observer { |
| | | it?.let { |
| | | sp_take_evidence_select_problem.adapter = ProblemTypeListAdapter(it, this) |
| | | } |
| | | }) |
| | | |
| | | viewModel.suggestionList.observe(this, Observer { |
| | | it.let { |
| | | sp_take_evidence_select_suggestion.adapter = ArrayAdapter(this, R.layout.item_spinner_drop_down, it) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | protected fun updateUIByProblemType(visible: Int) { |
| | | sp_take_evidence_select_location.visibility = visible |
| | | et_take_evidence_location.visibility = visible |
| | | iv_take_evidence_add_photo1.visibility = visible |
| | |
| | | } |
| | | |
| | | private fun putProblem() { |
| | | if (inspection == null || subTask == null || scene == null) { |
| | | toast("å½åå·¡æ¥ç¶æéè¯¯ï¼æ æ³ä¸ä¼ é®é¢ï¼è¯·å°è¯éæ°å¯å¨") |
| | | } |
| | | |
| | | val problemType = sp_take_evidence_select_problem_type.selectedItem.toString() |
| | | |
| | | val pro = Problemlist().apply { |
| | |
| | | sguid = scene?.guid |
| | | sensename = scene?.name |
| | | senseaddress = "${scene?.cityname ?: ""}${scene?.districtname ?: ""}${scene?.townname ?: ""}${scene?.location ?: ""}" |
| | | |
| | | val p = sp_take_evidence_select_problem.selectedItem |
| | | if (p is Problemtype) { |
| | | ptguid = p.guid |
| | |
| | | } |
| | | } |
| | | |
| | | private fun putMediaFile(problem: Problemlist) { |
| | | protected fun putMediaFile(problem: Problemlist) { |
| | | //ä¿åç
§çå°å¯¹åºæä»¶å¤¹ |
| | | val savePathList = ArrayList<File>() |
| | | val calendar = java.util.Calendar.getInstance() |
| | |
| | | fileNameList.add(fileName3) |
| | | |
| | | for (i in pathTempList.indices) { |
| | | val oldFile = pathTempList[i] |
| | | //è¿æ»¤ä¸éè¦ä¸ä¼ çå¾ç |
| | | if (!pathTempList[i].second) { |
| | | continue |
| | | } |
| | | val oldFile = pathTempList[i].first |
| | | val newFile = savePathList[i] |
| | | //ä¿åå°mediaFileæ°æ®åº |
| | | val mediaFile = Mediafile() |
| | |
| | | } |
| | | |
| | | //æ¸
餿ç
§åè¯çç¼å |
| | | fun clearTemp() { |
| | | private fun clearTemp() { |
| | | for (i in pathTempList.indices) { |
| | | val file = pathTempList[i] |
| | | //éè¦ä¸ä¼ çå¾çææ¯å¨æ¬å°ææçï¼å¸¦æç¼å |
| | | if (pathTempList[i].second) { |
| | | val file = pathTempList[i].first |
| | | if (file.exists()) { |
| | | file.delete() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import android.arch.lifecycle.MutableLiveData |
| | | import cn.flightfeather.thirdapp.bean.* |
| | | import cn.flightfeather.thirdapp.bean.vo.ProblemlistVo |
| | | import cn.flightfeather.thirdapp.common.net.ResultCallBack |
| | | import cn.flightfeather.thirdapp.model.event.ProblemEvent |
| | | import cn.flightfeather.thirdapp.module.base.BaseViewModel |
| | |
| | | import okhttp3.ResponseBody |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.toast |
| | | import java.io.File |
| | | |
| | | /** |
| | | * @author riku |
| | |
| | | |
| | | val problemMap = HashMap<String, ArrayList<Problemtype>>() |
| | | |
| | | val mediaFileList = MutableLiveData<List<Mediafile>>() |
| | | |
| | | //æææ°æ®å è½½å®æéç¥ |
| | | val loadingOver = MutableLiveData<Boolean>() |
| | | //è®°å½åä¸ªæ°æ®å è½½æ¯å¦å®æçç¶æ |
| | | private val loadingStatus = BooleanArray(3) |
| | | |
| | | /** |
| | | * è·ååºæ¯é®é¢å¯éä½ç½®ï¼ç®ååªæå·¥å°ï¼ä½ææåºæ¯é½ä½¿ç¨ï¼ |
| | | */ |
| | |
| | | override fun onSuccess(result: ArrayList<Domainitem>?) { |
| | | result?.let { |
| | | locationList.value = it |
| | | onLoaded(0) |
| | | } |
| | | } |
| | | |
| | |
| | | if (it.isEmpty()) { |
| | | it.add(Problemtype().apply { |
| | | guid = "0" |
| | | typename = "æ " |
| | | name = "æ " |
| | | typename = "å
¶ä»" |
| | | name = "å
¶ä»" |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | problemFatherType.value = typeList |
| | | |
| | | onLoaded(1) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | advices.add("ææ å»ºè®®") |
| | | suggestionList.value = advices |
| | | |
| | | onLoaded(2) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®é®é¢æ¾å°æå¡å¨åæ¬å°çææå¾ç |
| | | */ |
| | | fun getMediaFileList(p: ProblemlistVo) { |
| | | problemRepository.getMediaFileLocal(p.guid, object : ResultCallBack<List<Mediafile>> { |
| | | override fun onSuccess(result: List<Mediafile>?) { |
| | | result?.let { |
| | | p.mediafileList.addAll(it) |
| | | mediaFileList.value = p.mediafileList |
| | | } |
| | | } |
| | | |
| | | override fun onFailure() { |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * ä¸è½½é®é¢å¾ç |
| | | * fixme: 2020/8/6 ç®åç±äºåç¨åºè®¾ç½®å¾ççæ¹å¼ä¸ºæå¨ä¸è½½å¾çï¼å æ¤æ²¿ç¨ï¼ä¹åç»ä¸ç¨Glideçç¬¬ä¸æ¹åºä»£æ¿ |
| | | */ |
| | | fun downLoadMediaFile(mediaFile: Mediafile, s: (file: File) -> Unit) { |
| | | problemRepository.downloadMediaFile(mediaFile, object : ResultCallBack<File> { |
| | | override fun onSuccess(result: File?) { |
| | | result?.let { |
| | | s(it) |
| | | } |
| | | } |
| | | |
| | | override fun onFailure() { |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * å é¤é®é¢å¾ç |
| | | */ |
| | | fun deleteMediaFile(mediaFile: List<Mediafile>) { |
| | | mediaFile.forEach { |
| | | problemRepository.deleteMediaFile(it, object : ResultCallBack<Boolean> { |
| | | override fun onSuccess(result: Boolean?) { |
| | | |
| | | } |
| | | |
| | | override fun onFailure() { |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | application.toast("æäº¤å¤±è´¥") |
| | | } |
| | | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ä¸ä¸ªé®é¢ |
| | | */ |
| | | fun updateProblem(problem: ProblemlistVo) { |
| | | problemRepository.updateProblem(problem, object : ResultCallBack<ResponseBody> { |
| | | override fun onSuccess(result: ResponseBody?) { |
| | | result?.let { |
| | | application.toast("ä¿®æ¹æå") |
| | | EventBus.getDefault().post(ProblemEvent(problem.voToEntity())) |
| | | } |
| | | } |
| | | |
| | | override fun onFailure() { |
| | | application.toast("ä¿®æ¹å¤±è´¥ï¼è¯·æ£æ¥ç½ç»") |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | problemType.value = it |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 夿æ¯å¦ææçæ°æ®é½å è½½å®æ |
| | | */ |
| | | fun onLoaded(i: Int) { |
| | | if (i < loadingStatus.size) { |
| | | loadingStatus[i] = true |
| | | } |
| | | var isLoadOver = true |
| | | loadingStatus.forEach { |
| | | isLoadOver = isLoadOver.and(it) |
| | | } |
| | | if (isLoadOver) { |
| | | loadingOver.value = isLoadOver |
| | | for (y in loadingStatus.indices) { |
| | | loadingStatus[y] = false |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | override fun onResponse(call: Call<ResponseBody>, response: Response<ResponseBody>) { |
| | | if (response.body() != null) { |
| | | Toast.makeText(application, "æäº¤æå", Toast.LENGTH_SHORT).show() |
| | | for (oldfile in pathTempList) { |
| | | for (l in pathTempList) { |
| | | val oldfile = l.first |
| | | val fileName = gitSelected.name + " " + UUIDGenerator.generateUUID(4) + ".jpg" |
| | | val mediafile = Mediafile() |
| | | mediafile.guid = UUIDGenerator.generate16ShortUUID() |
| | |
| | | package cn.flightfeather.thirdapp.module.inspection |
| | | |
| | | import android.app.Dialog |
| | | import android.arch.lifecycle.Observer |
| | | import android.content.Intent |
| | | import android.os.Bundle |
| | | import android.view.View |
| | | import cn.flightfeather.thirdapp.adapter.ProblemListAdapter |
| | | import cn.flightfeather.thirdapp.util.DialogUtil2 |
| | | import kotlinx.android.synthetic.main.dialog_problem_list.* |
| | | |
| | | class MenuProblemListActivity : BaseProblemListActivity() { |
| | |
| | | |
| | | viewModel.getProblems(inspection?.guid) |
| | | } |
| | | |
| | | override fun onItemViewLongClick(view: View?, position: Int) { |
| | | super.onItemViewLongClick(view, position) |
| | | DialogUtil2.showBottomDialog(this, rootView, listOf("ä¿®æ¹", "å é¤"), listOf ({ p-> |
| | | val intent = Intent(this, MenuProblemUpdateActivity::class.java).apply { |
| | | putExtra("problemlistVo", viewModel.problemList.value?.get(position)) |
| | | putExtra("subTask", subTaskSelected) |
| | | putExtra("inspection", inspection) |
| | | putExtra("scene", scene) |
| | | putExtra("lat", lat) |
| | | putExtra("lng", lng) |
| | | } |
| | | startActivity(intent) |
| | | p.dismiss() |
| | | }, {p-> |
| | | p.dismiss() |
| | | DialogUtil2.showAlertDialog(this, "确认æ¯å¦å é¤é®é¢?", { dialog: Dialog -> |
| | | viewModel.deleteProblem(position) { |
| | | viewModel.getProblems(inspection?.guid) |
| | | } |
| | | dialog.dismiss() |
| | | }) { dialog: Dialog -> |
| | | dialog.dismiss() |
| | | } |
| | | })) |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.module.inspection |
| | | |
| | | import android.arch.lifecycle.Observer |
| | | import android.content.Intent |
| | | import android.os.Bundle |
| | | import android.os.Environment |
| | | import android.view.View |
| | | import android.widget.AdapterView |
| | | import cn.flightfeather.thirdapp.bean.Domainitem |
| | | import cn.flightfeather.thirdapp.bean.Mediafile |
| | | import cn.flightfeather.thirdapp.bean.Problemtype |
| | | import cn.flightfeather.thirdapp.bean.vo.ProblemlistVo |
| | | import cn.flightfeather.thirdapp.module.base.VIEW_PHOTO |
| | | import kotlinx.android.synthetic.main.dialog_take_evidence.* |
| | | import org.jetbrains.anko.toast |
| | | import java.io.File |
| | | import java.util.* |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/8/6 |
| | | * é®é¢å
å®¹ä¿®æ¹ |
| | | */ |
| | | class MenuProblemUpdateActivity : MenuEvidenceActivity() { |
| | | |
| | | private var problemVo: ProblemlistVo? = null |
| | | |
| | | private val deleteMediaFileList = mutableListOf<Mediafile>() |
| | | |
| | | //ä¿®æ¹åçé®é¢åç§° |
| | | private var originProblemName = "" |
| | | |
| | | private var firstLoad = true |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | | |
| | | tv_dialog_take_evidence_title.text = "é®é¢ä¿®æ¹" |
| | | |
| | | fab_take_evidence_ok.setOnClickListener { |
| | | val now = Date() |
| | | if (now.time - submitTime >= 1000) { |
| | | submitTime = now.time |
| | | updateProblem() |
| | | } |
| | | } |
| | | |
| | | problemVo?.let { |
| | | viewModel.getMediaFileList(it) |
| | | } |
| | | } |
| | | |
| | | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
| | | super.onActivityResult(requestCode, resultCode, data) |
| | | when (requestCode) { |
| | | VIEW_PHOTO -> { |
| | | //æ¥çä¸´æ¶ææå¾çå¯ä»¥å é¤ |
| | | data?.getIntExtra("position", -1)?.let { |
| | | if (it > -1) { |
| | | viewModel.mediaFileList.value?.get(it)?.let {m -> |
| | | deleteMediaFileList.add(m) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun getExtra() { |
| | | super.getExtra() |
| | | problemVo = intent.getSerializableExtra("problemlistVo") as ProblemlistVo |
| | | } |
| | | |
| | | override fun initObserver() { |
| | | super.initObserver() |
| | | viewModel.loadingOver.observe(this, Observer { |
| | | if (it == true && problemVo != null) { |
| | | //é®é¢ç±»å å é®é¢è¯¦æ
|
| | | var problemType = "" |
| | | val problemTypeId = problemVo!!.ptguid |
| | | with(viewModel.problemMap) breaking@{ |
| | | forEach { entry -> |
| | | entry.value.forEach { pt -> |
| | | if (pt.guid == problemTypeId) { |
| | | problemType = entry.key |
| | | originProblemName = pt.name |
| | | setSelectListener() |
| | | return@breaking |
| | | } |
| | | } |
| | | } |
| | | } |
| | | for (i in viewModel.problemFatherType.value?.indices ?: 0..0) { |
| | | if (viewModel.problemFatherType.value?.get(i) == problemType) { |
| | | sp_take_evidence_select_problem_type.setSelection(i) |
| | | break |
| | | } |
| | | } |
| | | //é®é¢æè¿° |
| | | var problemRemark = problemVo!!.problemname.replace(originProblemName, "")//å é¤æè¿°ä¸çé®é¢ç±»å |
| | | if (problemRemark.isNotBlank()) { |
| | | problemRemark = problemRemark.removeRange(0, 1)//å é¤ç¬¬ä¸ä¸ªåç¬¦ï¼æ¬å·âï¼â |
| | | problemRemark = problemRemark.dropLast(1)//å 餿åä¸ä¸ªåç¬¦ï¼æ¬å·âï¼â |
| | | } |
| | | |
| | | |
| | | et_take_evidence_problem_des.setText(problemRemark) |
| | | |
| | | //ä½ç½® |
| | | var location = problemVo!!.location |
| | | for (i in viewModel.locationList.value?.indices ?: 0..0) { |
| | | val d = viewModel.locationList.value?.get(i)?.text |
| | | if (d != null && location.contains(d)) { |
| | | location = location.replace(d, "") |
| | | sp_take_evidence_select_location.setSelection(i) |
| | | break |
| | | } |
| | | } |
| | | |
| | | //ä½ç½®å¤æ³¨ |
| | | var locationRemark = location |
| | | if (locationRemark.isNotBlank()) { |
| | | locationRemark = location.removeRange(0, 1)//å é¤ç¬¬ä¸ä¸ªåç¬¦ï¼æ¬å·âï¼â |
| | | locationRemark = locationRemark.dropLast(1)//å 餿åä¸ä¸ªåç¬¦ï¼æ¬å·âï¼â |
| | | } |
| | | et_take_evidence_location.setText(locationRemark) |
| | | |
| | | //æ´æ¹å»ºè®® |
| | | var advice = problemVo!!.advise |
| | | var suggestion = "" |
| | | for (i in viewModel.suggestionList.value?.indices ?: 0..0) { |
| | | val s = viewModel.suggestionList.value?.get(i) |
| | | if (s != null && advice.contains(s)) { |
| | | advice = advice.replace(s, "") |
| | | sp_take_evidence_select_suggestion.setSelection(i) |
| | | break |
| | | } |
| | | } |
| | | //æ´æ¹å»ºè®®å¤æ³¨ |
| | | var suggestionRemark = advice.removeRange(0, 1)//å é¤ç¬¬ä¸ä¸ªåç¬¦ï¼æ¬å·âï¼â |
| | | suggestionRemark = suggestionRemark.dropLast(1)//å 餿åä¸ä¸ªåç¬¦ï¼æ¬å·âï¼â |
| | | et_take_evidence_suggestion.setText(suggestionRemark) |
| | | } |
| | | }) |
| | | |
| | | viewModel.mediaFileList.observe(this, Observer { |
| | | it?.let { loadImage(it) } |
| | | }) |
| | | } |
| | | |
| | | private fun loadImage(mediaFileList: List<Mediafile>) { |
| | | mediaFileList.forEach { |
| | | if (!it.ischanged) { |
| | | val file = getFileFromMediaFile(it) |
| | | if (file?.exists() == true) { |
| | | pathTempList.add(Pair(file, false)) |
| | | } else { |
| | | viewModel.downLoadMediaFile(it) {f -> |
| | | pathTempList.add(Pair(f, false)) |
| | | refreshImageView() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | refreshImageView() |
| | | } |
| | | |
| | | private fun getFileFromMediaFile(mediafile: Mediafile): File? { |
| | | return File(Environment.getExternalStorageDirectory(), mediafile.path + mediafile.description) |
| | | } |
| | | |
| | | private fun updateProblem() { |
| | | val problemType = sp_take_evidence_select_problem_type.selectedItem.toString() |
| | | |
| | | problemVo?.apply { |
| | | val p = sp_take_evidence_select_problem.selectedItem |
| | | if (p is Problemtype) { |
| | | ptguid = p.guid |
| | | var problemDes = et_take_evidence_problem_des.text.toString() |
| | | if (problemDes.isNotEmpty()) { |
| | | problemDes = "($problemDes)" |
| | | } |
| | | problemname = p.name + problemDes |
| | | } |
| | | |
| | | var adviceDes = et_take_evidence_suggestion.text.toString() |
| | | if (adviceDes.isNotEmpty()) { |
| | | adviceDes = "($adviceDes)" |
| | | } |
| | | advise = sp_take_evidence_select_suggestion.selectedItem.toString() + adviceDes |
| | | latitude = lat |
| | | longitude = lng |
| | | |
| | | val d = sp_take_evidence_select_location.selectedItem |
| | | if (d is Domainitem) { |
| | | var locationRemark = et_take_evidence_location.text.toString() |
| | | if (locationRemark.isNotEmpty()) { |
| | | locationRemark = "($locationRemark)" |
| | | } |
| | | // fixme: 2020/6/9 æ¤çæ¬å°é®é¢ä½ç½®ä¿®æ¹ä¸ºè¡éä¿¡æ¯ï¼ææ¶å»é¤ä½ç½®id |
| | | locationid = d.index.toByte() |
| | | location = d.text + locationRemark |
| | | } |
| | | |
| | | time = Date() |
| | | |
| | | |
| | | |
| | | if (problemType != "æåº¦" && pathTempList.isNotEmpty()) { |
| | | viewModel.updateProblem(this) |
| | | putMediaFile(this.voToEntity()) |
| | | deleteMediaFile() |
| | | }else if (problemType == "æåº¦") { |
| | | viewModel.updateProblem(this) |
| | | deleteMediaFile() |
| | | } else { |
| | | application.toast("è³å°æä¸å¼ ç
§ç") |
| | | fab_take_evidence_ok.isClickable = true |
| | | } |
| | | } |
| | | } |
| | | |
| | | private fun deleteMediaFile() { |
| | | viewModel.deleteMediaFile(deleteMediaFileList) |
| | | } |
| | | |
| | | private fun setSelectListener() { |
| | | sp_take_evidence_select_problem_type.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { |
| | | override fun onNothingSelected(parent: AdapterView<*>?) = Unit |
| | | override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { |
| | | val problemType = viewModel.problemFatherType.value?.get(position) |
| | | viewModel.refreshProblems(problemType) |
| | | |
| | | viewModel.problemFatherType.value?.let { |
| | | if (it[position] == "æåº¦") { |
| | | updateUIByProblemType(View.GONE) |
| | | } else { |
| | | updateUIByProblemType(View.VISIBLE) |
| | | } |
| | | } |
| | | |
| | | val problemNameList = viewModel.problemMap[problemType] ?: arrayListOf() |
| | | for (i in problemNameList.indices) { |
| | | if (problemNameList[i].name == originProblemName) { |
| | | sp_take_evidence_select_problem.setSelection(i) |
| | | break |
| | | } |
| | | } |
| | | |
| | | viewModel.problemType.value?.get(0)?.guid?.let { viewModel.getSuggestionList(it) } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | var totalProblemCount = 0 |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | EventBus.getDefault().register(this) |
| | | |
| | | super.onCreate(savedInstanceState) |
| | | |
| | | viewModel.subTaskPack.observe(this, Observer { |
| | |
| | | |
| | | @Subscribe(threadMode = ThreadMode.BACKGROUND) |
| | | fun onUpdateRecheck(problemEvent: ProblemEvent) { |
| | | if (problemEvent.type == InspectionFragment.PROBLEM_RECHECK) { |
| | | if (problemEvent.type == InspectionDetailActivity.PROBLEM_RECHECK) { |
| | | inspection?.apply { |
| | | recheckcount = recheckcount?.plus(1) ?: 1 |
| | | |
| | |
| | | .upLoadCrashInfo(accountName, partList) |
| | | .subscribeOn(Schedulers.io()) |
| | | .observeOn(Schedulers.trampoline()) |
| | | .subscribe() |
| | | .subscribe({ |
| | | resultCallBack.onSuccess(it.body()) |
| | | }, { |
| | | resultCallBack.onFailure() |
| | | }) |
| | | } |
| | | } |
| | |
| | | package cn.flightfeather.thirdapp.repository |
| | | |
| | | import android.annotation.SuppressLint |
| | | import android.os.Environment |
| | | import cn.flightfeather.thirdapp.bean.* |
| | | import cn.flightfeather.thirdapp.common.net.ResponseBodyCallBack |
| | | import cn.flightfeather.thirdapp.common.net.ResultCallBack |
| | | import cn.flightfeather.thirdapp.common.net.ResultObserver |
| | | import cn.flightfeather.thirdapp.common.net.RetrofitFactory |
| | | import cn.flightfeather.thirdapp.bean.vo.ProblemlistVo |
| | | import cn.flightfeather.thirdapp.common.net.* |
| | | import cn.flightfeather.thirdapp.httpservice.InspectionService |
| | | import cn.flightfeather.thirdapp.httpservice.MediaFileService |
| | | import cn.flightfeather.thirdapp.httpservice.ProblemListService |
| | | import cn.flightfeather.thirdapp.repository.dao.DomainDao |
| | | import cn.flightfeather.thirdapp.repository.dao.MediaFileDao |
| | | import cn.flightfeather.thirdapp.repository.dao.ProblemTypeDao |
| | | import io.reactivex.android.schedulers.AndroidSchedulers |
| | | import io.reactivex.schedulers.Schedulers |
| | | import okhttp3.ResponseBody |
| | | import retrofit2.Call |
| | | import retrofit2.Callback |
| | | import retrofit2.Response |
| | | import java.io.BufferedInputStream |
| | | import java.io.File |
| | | import java.io.FileOutputStream |
| | | import java.io.IOException |
| | | |
| | | /** |
| | | * @author riku |
| | |
| | | class ProblemRepository { |
| | | |
| | | val retrofit = RetrofitFactory.instance.retrofit |
| | | val retrofitImage = RetrofitFactory.instance.retrofitImage |
| | | private val domainDao = DomainDao() |
| | | private val problemTypeDao = ProblemTypeDao() |
| | | private val mediaFileDao = MediaFileDao() |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°é®é¢ |
| | | */ |
| | | fun updateProblem(problem: ProblemlistVo, resultCallBack: ResultCallBack<ResponseBody>) { |
| | | retrofit.create(ProblemListService::class.java).updateProblemList(problem) |
| | | .enqueue(ResponseBodyCallBack(resultCallBack)) |
| | | } |
| | | |
| | | /** |
| | | * å¾çæ¬å°ç¼å |
| | | */ |
| | | fun putMediaFileLocal(mediaFile: Mediafile, resultCallBack: ResultCallBack<Int>) { |
| | |
| | | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¬å°ç¼åçå¾ç |
| | | */ |
| | | fun getMediaFileLocal(problemGuid: String, resultCallBack: ResultCallBack<List<Mediafile>>) { |
| | | val dbService = mediaFileDao.getMediaFileByProblemId(problemGuid).map { |
| | | Response.success(it) |
| | | } |
| | | |
| | | RetrofitFactory.executeResult(dbService, object : ResultObserver<List<Mediafile>>() { |
| | | override fun onSuccess(result: List<Mediafile>?) { |
| | | resultCallBack.onSuccess(result) |
| | | } |
| | | |
| | | override fun onFailure(e: Throwable, isNetWorkError: Boolean) { |
| | | resultCallBack.onFailure() |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * ä¸è½½é®é¢å¾ç |
| | | */ |
| | | fun downloadMediaFile(mediaFile:Mediafile, resultCallBack: ResultCallBack<File>) { |
| | | val url: String = mediaFile.extension1 + mediaFile.guid + ".jpg" |
| | | retrofitImage.create(MediaFileService::class.java).downloadImage(url) |
| | | .enqueue(object : Callback<ResponseBody> { |
| | | override fun onFailure(call: Call<ResponseBody>, t: Throwable) { |
| | | resultCallBack.onFailure() |
| | | } |
| | | |
| | | override fun onResponse(call: Call<ResponseBody>, response: Response<ResponseBody>) { |
| | | if (response.body() != null) { |
| | | val file = writeResponseBodyToDisk(mediaFile, response.body()) |
| | | if (file?.exists() == true) { |
| | | resultCallBack.onSuccess(file) |
| | | } else { |
| | | resultCallBack.onFailure() |
| | | } |
| | | } else { |
| | | resultCallBack.onFailure() |
| | | } |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | /** |
| | | * å é¤é®é¢å¾ç |
| | | */ |
| | | @SuppressLint("CheckResult") |
| | | fun deleteMediaFile(mediaFile: Mediafile, resultCallBack: ResultCallBack<Boolean>) { |
| | | if (mediaFile.remark == "æªä¸ä¼ ") { |
| | | mediaFileDao.deleteMediaFile(mediaFile.guid) |
| | | .subscribeOn(Schedulers.io()) |
| | | .observeOn(AndroidSchedulers.mainThread()) |
| | | .subscribe{ |
| | | if (it) { |
| | | resultCallBack.onSuccess(it) |
| | | } |
| | | } |
| | | } else if (mediaFile.remark == "å·²ä¸ä¼ ") { |
| | | retrofit.create(MediaFileService::class.java).deleteMediaFile(mediaFile.guid) |
| | | .enqueue(object : Callback<ResponseBody?> { |
| | | override fun onResponse(call: Call<ResponseBody?>, response: Response<ResponseBody?>) { |
| | | if (response.body() != null) { |
| | | mediaFileDao.deleteMediaFile(mediaFile.guid) |
| | | .subscribeOn(Schedulers.io()) |
| | | .observeOn(AndroidSchedulers.mainThread()) |
| | | .subscribe{ |
| | | if (it) { |
| | | resultCallBack.onSuccess(it) |
| | | } |
| | | } |
| | | } else if (response.errorBody() != null) { |
| | | resultCallBack.onFailure() |
| | | } |
| | | } |
| | | |
| | | override fun onFailure(call: Call<ResponseBody?>, t: Throwable) { |
| | | resultCallBack.onFailure() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å é¤é®é¢ |
| | | */ |
| | | fun deleteProblem(problemId: String, resultCallBack: ResultCallBack2<Int>) { |
| | | retrofit.create(ProblemListService::class.java).deleteProblem(problemId) |
| | | .enqueue(ResponseBodyCallBack2(resultCallBack)) |
| | | } |
| | | |
| | | //å°ä¸è½½çå¾çåå
¥ç£ç |
| | | private fun writeResponseBodyToDisk(mediafile: Mediafile, body: ResponseBody?): File? { |
| | | if (body == null) { |
| | | return null |
| | | } |
| | | return try { |
| | | val `is` = body.byteStream() |
| | | var file = File(Environment.getExternalStorageDirectory(), mediafile.path + mediafile.description) |
| | | if (file.exists()) { |
| | | file.delete() |
| | | file = File(Environment.getExternalStorageDirectory(), mediafile.path + mediafile.description) |
| | | } |
| | | file.parentFile.mkdirs() |
| | | val fos = FileOutputStream(file) |
| | | val bis = BufferedInputStream(`is`) |
| | | val buffer = ByteArray(1024) |
| | | var len: Int |
| | | while (bis.read(buffer).also { len = it } != -1) { |
| | | fos.write(buffer, 0, len) |
| | | } |
| | | fos.flush() |
| | | fos.close() |
| | | bis.close() |
| | | `is`.close() |
| | | file |
| | | } catch (e: IOException) { |
| | | e.printStackTrace() |
| | | null |
| | | } |
| | | } |
| | | } |
| | |
| | | ).list() |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®é®é¢idè·å对åºçç¸å
³å¾ç |
| | | */ |
| | | fun getMediaFileByProblemId(problemId: String): Observable<List<Mediafile>> { |
| | | return DbFactory.getGreenDaoObservable().map { |
| | | it.mediafileDao.queryBuilder().where( |
| | | MediafileDao.Properties.Businessguid.eq(problemId), |
| | | MediafileDao.Properties.Remark.eq("æªä¸ä¼ ") |
| | | ).list() |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å é¤å¾ç |
| | | */ |
| | | fun deleteMediaFile(id: String): Observable<Boolean> { |
| | | return DbFactory.getGreenDaoObservable().map { |
| | | it.mediafileDao.deleteByKey(id) |
| | | true |
| | | } |
| | | } |
| | | } |
| | |
| | | import android.widget.TextView |
| | | import cn.flightfeather.thirdapp.R |
| | | import cn.flightfeather.thirdapp.module.base.BaseActivity |
| | | import cn.flightfeather.thirdapp.view.PopupWindowWithMask |
| | | |
| | | /** |
| | | * @author riku |
| | |
| | | ) { |
| | | val view = LayoutInflater.from(activity).inflate(R.layout.dialog_bottom_sheet, null) |
| | | activity?.let { |
| | | PopupWindow(it).apply popupWindow@{ |
| | | PopupWindowWithMask(it).apply popupWindow@{ |
| | | isFocusable = true |
| | | isOutsideTouchable = true |
| | | contentView = view |
| | |
| | | width = ViewGroup.LayoutParams.MATCH_PARENT |
| | | animationStyle = R.style.PopWin_bottom_anim_style |
| | | background.alpha = 0 |
| | | setOnDismissListener { |
| | | val wl = activity.window.attributes |
| | | wl.alpha = 1f |
| | | activity.window.attributes = wl |
| | | } |
| | | }.run { |
| | | val wl = activity.window.attributes |
| | | wl.alpha = 0.9f |
| | | activity.window.attributes = wl |
| | | showAtLocation(anchorView, Gravity.BOTTOM, 0, 0) |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | public void downLoadApk() { |
| | | try { |
| | | DownloadManager.Request request = new DownloadManager.Request(Uri.parse(versionVo.getDownloadUrl())); |
| | | request.setTitle("ç¬¬ä¸æ¹ç管"); |
| | | request.setTitle(application.getString(R.string.app_name)); |
| | | request.setDescription("æ£å¨ä¸è½½..."); |
| | | request.setDestinationInExternalFilesDir(application, Environment.DIRECTORY_DOWNLOADS, "supervision.apk"); |
| | | downloadManager = (DownloadManager) application.getSystemService(Context.DOWNLOAD_SERVICE); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.view |
| | | |
| | | import android.content.Context |
| | | import android.graphics.PixelFormat |
| | | import android.os.IBinder |
| | | import android.view.KeyEvent |
| | | import android.view.View |
| | | import android.view.WindowManager |
| | | import android.widget.PopupWindow |
| | | import org.jetbrains.anko.windowManager |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/8/28 |
| | | */ |
| | | class PopupWindowWithMask(private val context: Context) : PopupWindow(context) { |
| | | |
| | | private var windowManager: WindowManager? = null |
| | | private var maskView: View? = null |
| | | |
| | | init { |
| | | windowManager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager |
| | | } |
| | | |
| | | override fun showAtLocation(parent: View?, gravity: Int, x: Int, y: Int) { |
| | | addMask(parent?.windowToken) |
| | | super.showAtLocation(parent, gravity, x, y) |
| | | } |
| | | |
| | | override fun dismiss() { |
| | | removeMask() |
| | | super.dismiss() |
| | | } |
| | | |
| | | private fun addMask(token: IBinder?) { |
| | | val wl: WindowManager.LayoutParams = WindowManager.LayoutParams() |
| | | wl.width = WindowManager.LayoutParams.MATCH_PARENT |
| | | wl.height = WindowManager.LayoutParams.MATCH_PARENT |
| | | wl.format = PixelFormat.TRANSLUCENT //ä¸è®¾ç½®è¿ä¸ªå¼¹åºæ¡çéæé®ç½©æ¾ç¤ºä¸ºé»è² |
| | | wl.type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL //该Typeæè¿°çæ¯å½¢æççªå£çå±çº§å
³ç³» |
| | | wl.token = token //è·åå½åActivityä¸çViewä¸çtoken,æ¥ä¾éActivity |
| | | maskView = View(context) |
| | | maskView?.setBackgroundColor(0x7f000000) |
| | | maskView?.fitsSystemWindows = false |
| | | maskView?.setOnKeyListener(View.OnKeyListener { v, keyCode, event -> |
| | | if (keyCode == KeyEvent.KEYCODE_BACK) { |
| | | removeMask() |
| | | return@OnKeyListener true |
| | | } |
| | | false |
| | | }) |
| | | /** |
| | | * éè¿WindowManagerçaddViewæ¹æ³å建Viewï¼äº§çåºæ¥çViewæ ¹æ®WindowManager.LayoutParams屿§ä¸åï¼ææä¹å°±ä¸åäºã |
| | | * æ¯å¦å建系ç»é¡¶çº§çªå£ï¼å®ç°æ¬æµ®çªå£ææï¼ |
| | | */ |
| | | windowManager?.addView(maskView, wl) |
| | | } |
| | | |
| | | private fun removeMask() { |
| | | if (null != maskView) { |
| | | windowManager?.removeViewImmediate(maskView) |
| | | maskView = null |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layer-list |
| | | xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <item> |
| | | <shape |
| | | android:shape="rectangle"> |
| | | <!-- å¡«å
çé¢è² --> |
| | | <solid android:color="@color/white"/> |
| | | <!-- 设置æé®çå个è§ä¸ºå¼§å½¢ --> |
| | | <!-- android:radius å¼§å½¢çåå¾ --> |
| | | <corners android:radius="2dp" /> |
| | | <!--æè¾¹--> |
| | | <stroke |
| | | android:width="1dp" |
| | | android:color="@color/black" /> |
| | | <!-- paddingï¼Buttonéé¢çæåä¸Buttonè¾¹ççé´é --> |
| | | </shape> |
| | | </item> |
| | | <item android:drawable="@drawable/ic_unfold_more_black_20dp" |
| | | android:gravity="end|center"/> |
| | | </layer-list> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <vector android:height="20dp" android:viewportHeight="24.0" |
| | | android:viewportWidth="24.0" android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <path android:fillColor="#FF000000" android:pathData="M12,5.83L15.17,9l1.41,-1.41L12,3 7.41,7.59 8.83,9 12,5.83zM12,18.17L8.83,15l-1.41,1.41L12,21l4.59,-4.59L15.17,15 12,18.17z"/> |
| | | </vector> |
| | |
| | | <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | android:layout_height="match_parent" |
| | | xmlns:tools="http://schemas.android.com/tools"> |
| | | |
| | | <android.support.design.widget.FloatingActionButton |
| | | android:src="@drawable/icon_close_white" |
| | |
| | | android:id="@+id/tv_dialog_take_evidence_title" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="æ°å¢é®é¢" |
| | | android:text="é®é¢åè¯" |
| | | android:textColor="@color/primary_text" |
| | | android:textSize="18dp" /> |
| | | android:textSize="18sp" /> |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | |
| | | android:id="@+id/sp_take_evidence_select_problem_type" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="-7dp" |
| | | android:layout_marginRight="-7dp"></Spinner> |
| | | android:layout_marginTop="@dimen/dimen4" |
| | | style="@style/SpinnerStyle.Black" |
| | | tools:listitem="@layout/item_spinner_drop_down" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_chose" |
| | |
| | | android:id="@+id/sp_take_evidence_select_problem" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="-7dp" |
| | | android:layout_marginRight="-7dp"></Spinner> |
| | | android:layout_marginTop="@dimen/dimen4" |
| | | style="@style/SpinnerStyle.Black" |
| | | tools:listitem="@layout/item_spinner_drop_down"/> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_take_evidence_problem_des" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="8dp" |
| | | android:hint="é®é¢æè¿°(å¯é)" |
| | | android:textSize="@dimen/textSize_14" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | |
| | | android:id="@+id/sp_take_evidence_select_location" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="-7dp" |
| | | android:layout_marginRight="-7dp"></Spinner> |
| | | android:layout_marginTop="@dimen/dimen4" |
| | | style="@style/SpinnerStyle.Black" |
| | | tools:listitem="@layout/item_spinner_drop_down"/> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_take_evidence_location" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:hint="ä½ç½®å¤æ³¨(å¯é)" /> |
| | | android:hint="ä½ç½®å¤æ³¨(å¯é)" |
| | | android:textSize="@dimen/textSize_14"/> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_change_suggestion" |
| | |
| | | android:id="@+id/sp_take_evidence_select_suggestion" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="-7dp" |
| | | android:layout_marginRight="-7dp"> |
| | | </Spinner> |
| | | android:layout_marginTop="@dimen/dimen4" |
| | | style="@style/SpinnerStyle.Black" |
| | | tools:listitem="@layout/item_spinner_drop_down"/> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_take_evidence_suggestion" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:hint="æ´æ¹å»ºè®®(å¯é)" /> |
| | | android:hint="æ´æ¹å»ºè®®(å¯é)" |
| | | android:textSize="@dimen/textSize_14"/> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | <android.support.constraint.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginBottom="10dp" |
| | |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_take_evidence_add_photo1" |
| | | android:layout_width="60dp" |
| | | android:layout_height="60dp" |
| | | android:layout_marginTop="6dp" |
| | | android:scaleType="centerCrop" |
| | | android:src="@drawable/icon_add_photo" /> |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | android:scaleType="fitCenter" |
| | | android:src="@drawable/icon_add_photo" |
| | | android:layout_marginEnd="@dimen/dimen8" |
| | | app:layout_constraintDimensionRatio="W, 1:1" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toStartOf="@id/iv_take_evidence_add_photo2" |
| | | app:layout_constraintTop_toTopOf="parent"/> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_take_evidence_add_photo2" |
| | | android:layout_width="60dp" |
| | | android:layout_height="60dp" |
| | | android:layout_marginLeft="10dp" |
| | | android:layout_marginTop="6dp" |
| | | android:scaleType="centerCrop" |
| | | android:src="@drawable/icon_add_photo_blank" /> |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | android:scaleType="fitCenter" |
| | | android:src="@drawable/icon_add_photo_blank" |
| | | android:layout_marginEnd="@dimen/dimen8" |
| | | app:layout_constraintDimensionRatio="W, 1:1" |
| | | app:layout_constrainedWidth="true" |
| | | app:layout_constraintStart_toEndOf="@id/iv_take_evidence_add_photo1" |
| | | app:layout_constraintEnd_toStartOf="@id/iv_take_evidence_add_photo3" |
| | | app:layout_constraintTop_toTopOf="parent"/> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_take_evidence_add_photo3" |
| | | android:layout_width="60dp" |
| | | android:layout_height="60dp" |
| | | android:layout_marginLeft="10dp" |
| | | android:layout_marginTop="6dp" |
| | | android:scaleType="centerCrop" |
| | | android:src="@drawable/icon_add_photo_blank" /> |
| | | </LinearLayout> |
| | | android:layout_width="0dp" |
| | | android:layout_height="0dp" |
| | | android:scaleType="fitCenter" |
| | | android:src="@drawable/icon_add_photo_blank" |
| | | app:layout_constraintDimensionRatio="W, 1:1" |
| | | app:layout_constrainedWidth="true" |
| | | app:layout_constraintStart_toEndOf="@id/iv_take_evidence_add_photo2" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent"/> |
| | | </android.support.constraint.ConstraintLayout> |
| | | |
| | | </LinearLayout> |
| | | </ScrollView> |
| | | </android.support.v7.widget.CardView> |
| | |
| | | android:textSize="14sp" |
| | | tools:text="@string/app_name" |
| | | android:maxLines="1" |
| | | android:padding="@dimen/dimen8" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | android:layout_height="wrap_content" |
| | | android:ellipsize="end" /> |
| | |
| | | <string name="problem_recheck">é®é¢å¤æ ¸</string> |
| | | <string name="history_patrol">åå²å·¡æ¥</string> |
| | | <string name="locale_take_evidence">é®é¢åè¯</string> |
| | | <string name="problem_update">é®é¢ä¿®æ¹</string> |
| | | <string name="question_list">é®é¢æ¸
å</string> |
| | | <string name="locale_change">ç°åºæ´æ¹</string> |
| | | <string name="colligate_score">综åè¯å</string> |
| | |
| | | <item name="android:textSize">12sp</item> |
| | | </style> |
| | | |
| | | <style name="SpinnerStyle"> |
| | | <item name="android:textColor">@color/main_color_1</item> |
| | | <item name="android:textSize">14sp</item> |
| | | <item name="android:background">@drawable/shape_black_spinner</item> |
| | | <item name="android:paddingEnd">20dp</item> |
| | | </style> |
| | | |
| | | <style name="SpinnerStyle.Black" > |
| | | <item name="android:background">@drawable/shape_black_spinner</item> |
| | | </style> |
| | | |
| | | <!-- //æ ç¾æåæ ·å¼--> |
| | | <style name="TextStyle.Tag"> |
| | | <item name="android:textColor">@color/boardGreen</item> |