Commit d47ef1bd authored by Amin's avatar Amin

add filter function

parent bea10f55
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.Qms"> android:theme="@style/Theme.Qms">
<activity <activity
android:name=".FilterIssueList"
android:exported="false" />
<activity
android:name=".WithdrawIssueSummary" android:name=".WithdrawIssueSummary"
android:exported="false" /> android:exported="false" />
<activity <activity
......
package com.example.qms;
import android.app.DatePickerDialog;
import android.os.Bundle;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
public class FilterIssueList extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_filter_issue_list);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
LinearLayout dateSelectorTo = findViewById(R.id.date_selector_to);
TextView tvDateTo = findViewById(R.id.tv_date_to);
LinearLayout dateSelectorFrom = findViewById(R.id.date_selector_from);
TextView tvDateFrom = findViewById(R.id.tv_date_from);
ImageButton backButon = findViewById(R.id.back_button);
backButon.setOnClickListener(v -> {
onBackPressed();
});
dateSelectorTo.setOnClickListener(v -> {
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
DatePickerDialog datePicker = new DatePickerDialog(
this,
(view, year1, month1, dayOfMonth) -> {
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yyyy", Locale.getDefault());
Calendar selectedDate = Calendar.getInstance();
selectedDate.set(year1, month1, dayOfMonth);
tvDateTo.setText(sdf.format(selectedDate.getTime()));
},
year, month, day
);
datePicker.show();
});
dateSelectorFrom.setOnClickListener(v -> {
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
DatePickerDialog datePicker = new DatePickerDialog(
this,
(view, year1, month1, dayOfMonth) -> {
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yyyy", Locale.getDefault());
Calendar selectedDate = Calendar.getInstance();
selectedDate.set(year1, month1, dayOfMonth);
tvDateFrom.setText(sdf.format(selectedDate.getTime()));
},
year, month, day
);
datePicker.show();
});
}
}
\ No newline at end of file
...@@ -12,7 +12,7 @@ import androidx.core.view.WindowInsetsCompat; ...@@ -12,7 +12,7 @@ import androidx.core.view.WindowInsetsCompat;
public class Issues extends AppCompatActivity { public class Issues extends AppCompatActivity {
private ImageButton withdrawIssueIcon, back_button; private ImageButton withdrawIssueIcon, back_button, filter_issue;
...@@ -29,12 +29,19 @@ public class Issues extends AppCompatActivity { ...@@ -29,12 +29,19 @@ public class Issues extends AppCompatActivity {
withdrawIssueIcon = findViewById(R.id.withdraw_issue_icon); withdrawIssueIcon = findViewById(R.id.withdraw_issue_icon);
back_button = findViewById(R.id.backButton); back_button = findViewById(R.id.backButton);
filter_issue = findViewById(R.id.filterIssue);
withdrawIssueIcon.setOnClickListener(v -> { withdrawIssueIcon.setOnClickListener(v -> {
Intent intent = new Intent(Issues.this, WithdrawIssue.class); Intent intent = new Intent(Issues.this, WithdrawIssue.class);
startActivity(intent); startActivity(intent);
}); });
filter_issue.setOnClickListener(v -> {
Intent intent = new Intent(Issues.this, FilterIssueList.class);
startActivity(intent);
});
back_button.setOnClickListener(v -> { back_button.setOnClickListener(v -> {
onBackPressed(); onBackPressed();
}); });
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFFFF" />
<stroke android:width="1dp" android:color="@color/sync_button" />
<corners android:radius="30dp" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FilterIssueList">
<LinearLayout
android:id="@+id/top_nav"
android:layout_width="match_parent"
android:layout_height="117dp"
android:background="@color/primary"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<View
android:layout_width="match_parent"
android:layout_height="59dp" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="59dp">
<ImageButton
android:id="@+id/back_button"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginStart="16dp"
android:background="@null"
android:src="@drawable/cancel"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/titleText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Filter Issue List"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/date_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="21dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/top_nav"
android:gravity="center_horizontal"
android:layout_marginTop="15dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Date Range"
android:textStyle="bold"
android:textSize="19sp"
android:layout_marginBottom="10dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:layout_marginEnd="10dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="From"
android:textSize="19dp"
android:textStyle="bold"
android:textColor="@color/sync_button"
android:textAlignment="center"/>
<LinearLayout
android:id="@+id/date_selector_from"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/date_selector_background"
android:gravity="center_vertical"
android:paddingHorizontal="20dp"
android:paddingVertical="15dp"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/tv_date_from"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="03 Jan 2025"
android:textSize="15sp"
android:textColor="#000000" />
<ImageView
android:id="@+id/iv_calendar_from"
android:layout_width="27dp"
android:layout_height="27dp"
android:src="@drawable/calendar"
android:contentDescription="Calendar Icon" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="To"
android:textSize="19dp"
android:textStyle="bold"
android:textColor="@color/sync_button"
android:textAlignment="center"/>
<LinearLayout
android:id="@+id/date_selector_to"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/date_selector_background"
android:gravity="center_vertical"
android:paddingHorizontal="20dp"
android:paddingVertical="15dp"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/tv_date_to"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="03 Jan 2025"
android:textSize="15sp"
android:textColor="#000000" />
<ImageView
android:id="@+id/iv_calendar_to"
android:layout_width="27dp"
android:layout_height="27dp"
android:src="@drawable/calendar"
android:contentDescription="Calendar Icon" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="21dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/date_section"
android:gravity="center_horizontal"
android:layout_marginTop="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Status"
android:textStyle="bold"
android:textSize="19sp"
android:layout_marginBottom="10dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/white"
android:clickable="true"
android:elevation="20dp"
android:focusable="true"
android:text="All"
android:textColor="@android:color/black"
android:textSize="17sp"
app:cornerRadius="40dp"
app:strokeColor="@color/sync_button"
app:strokeWidth="1dp"
android:paddingHorizontal="20dp"
android:layout_marginEnd="10dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/white"
android:clickable="true"
android:elevation="20dp"
android:focusable="true"
android:text="Lodged"
android:textColor="@android:color/black"
android:textSize="17sp"
app:cornerRadius="40dp"
app:strokeColor="@color/sync_button"
app:strokeWidth="1dp"
android:paddingHorizontal="20dp"
android:layout_marginEnd="10dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/white"
android:clickable="true"
android:elevation="20dp"
android:focusable="true"
android:text="Pending Access"
android:textColor="@android:color/black"
android:textSize="17sp"
app:cornerRadius="40dp"
app:strokeColor="@color/sync_button"
app:strokeWidth="1dp"
android:paddingHorizontal="20dp"
android:layout_marginEnd="10dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/white"
android:clickable="true"
android:elevation="20dp"
android:focusable="true"
android:text="WIP"
android:textColor="@android:color/black"
android:textSize="17sp"
app:cornerRadius="40dp"
app:strokeColor="@color/sync_button"
app:strokeWidth="1dp"
android:paddingHorizontal="20dp"
android:layout_marginEnd="10dp"/>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -122,6 +122,7 @@ ...@@ -122,6 +122,7 @@
android:textStyle="bold" /> android:textStyle="bold" />
<ImageButton <ImageButton
android:id="@+id/filterIssue"
android:layout_width="27dp" android:layout_width="27dp"
android:layout_height="27dp" android:layout_height="27dp"
android:background="@color/white" android:background="@color/white"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment