mirror of
https://github.com/hmalik144/Driver.git
synced 2026-03-18 15:36:03 +00:00
- lint checks
This commit is contained in:
@@ -1,107 +0,0 @@
|
||||
package h_mal.appttude.com.driver.ui
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import androidx.cardview.widget.CardView
|
||||
|
||||
|
||||
class DriverStatusClass : View.OnClickListener {
|
||||
var userId: String? = null
|
||||
var cardView: CardView? = null
|
||||
var context: Context? = null
|
||||
var currentSelection: Boolean = false
|
||||
override fun onClick(v: View) {
|
||||
val choices: Array<String> = arrayOf("Active", "Inactive")
|
||||
val alertDialog: AlertDialog.Builder = AlertDialog.Builder(context)
|
||||
var selection: Int = -1
|
||||
if (currentSelection) {
|
||||
selection = 0
|
||||
} else if (!currentSelection) {
|
||||
selection = 1
|
||||
}
|
||||
alertDialog.setSingleChoiceItems(
|
||||
choices,
|
||||
selection
|
||||
) { dialog, which -> }
|
||||
alertDialog.create().show()
|
||||
}
|
||||
|
||||
private fun SetStatus(status: Boolean) {
|
||||
// MainActivity.mDatabase!!.child(FirebaseClass.USER_FIREBASE)
|
||||
// .child((userId)!!).child(FirebaseClass.DRIVER_STATUS).setValue(status)
|
||||
// .addOnCompleteListener { task ->
|
||||
// if (task.isSuccessful) {
|
||||
// cardView!!.setBackgroundColor(setStatusColour(status))
|
||||
// } else {
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private fun setStatusColour(b: Boolean): Int {
|
||||
if (b) {
|
||||
return android.R.color.holo_green_dark
|
||||
} else {
|
||||
return android.R.color.holo_red_dark
|
||||
}
|
||||
} // public int getOverApprovalStatusCode(WholeDriverObject wholeDriverObject){
|
||||
//
|
||||
// if (wholeDriverObject.approvalsObject != null){
|
||||
// ApprovalsObject approvalsObject = wholeDriverObject.approvalsObject;
|
||||
//
|
||||
// int[] ints = new int[]{approvalsObject.getDriver_details_approval(),
|
||||
// approvalsObject.driver_license_approval,
|
||||
// approvalsObject.private_hire_approval,
|
||||
// approvalsObject.vehicle_details_approval,
|
||||
// approvalsObject.insurance_details_approval,
|
||||
// approvalsObject.mot_details_approval,
|
||||
// approvalsObject.log_book_approval,
|
||||
// approvalsObject.ph_car_approval};
|
||||
//
|
||||
//
|
||||
// return setImageResource(mode(ints));
|
||||
// }
|
||||
//
|
||||
// return setImageResource(NO_DATE_PRESENT);
|
||||
// }
|
||||
//
|
||||
// public void setStatusCode(String userId,String approvalNameString,int status){
|
||||
//
|
||||
// if (!approvalNameString.equals("")) {
|
||||
// mDatabase.child(USER_FIREBASE).child(userId).child(USER_APPROVALS).child(approvalNameString)
|
||||
// .setValue(status).addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
// @Override
|
||||
// public void onComplete(@NonNull Task<Void> task) {
|
||||
// if (task.isSuccessful()) {
|
||||
//
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public int setImageResource(int statusCode){
|
||||
// int imageResource;
|
||||
//
|
||||
// switch (statusCode){
|
||||
// case APPROVAL_PENDING:
|
||||
// imageResource = R.drawable.pending;
|
||||
// break;
|
||||
// case APPROVAL_DENIED:
|
||||
// imageResource = R.drawable.denied;
|
||||
// break;
|
||||
// case APPROVED:
|
||||
// imageResource = R.drawable.approved;
|
||||
// break;
|
||||
// default:
|
||||
// imageResource = R.drawable.zero;
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// return imageResource;
|
||||
// }
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center"
|
||||
app:cardCornerRadius="22dp"
|
||||
app:cardBackgroundColor="@android:color/transparent"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/cardviewoutline" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/approval_iv"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_gravity="center"
|
||||
tools:src="@drawable/pending" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/approval_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Private Hire License" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_margin="12dp">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/archive_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_archive_black_24dp"
|
||||
app:tint="@color/colour_three" />
|
||||
</FrameLayout>
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -3,7 +3,6 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/background_with_curve"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
android:id="@+id/driverPic"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginLeft="24dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:adjustViewBounds="true"
|
||||
@@ -26,18 +26,19 @@
|
||||
android:id="@+id/approval_iv"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginRight="3dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:layout_marginTop="3dp"
|
||||
app:layout_constraintTop_toTopOf="@id/driverPic"
|
||||
app:layout_constraintRight_toRightOf="@id/driverPic"
|
||||
android:adjustViewBounds="true"
|
||||
tools:src="@android:drawable/presence_online" />
|
||||
tools:src="@android:drawable/presence_online"
|
||||
android:contentDescription="@string/user_status" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/driver_no"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
@@ -48,7 +49,7 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="24dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="@id/driverPic"
|
||||
app:layout_constraintLeft_toRightOf="@id/driverPic"
|
||||
|
||||
Reference in New Issue
Block a user