Commit 4409af39 authored by Kavindu Randika's avatar Kavindu Randika

search section inital 1

parent 2dc624ca
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
......
......@@ -5,11 +5,14 @@
<map>
<entry key="..\:/Users/wishwa/StudioProjects/Skidndiseaseapp/app/src/main/res/drawable/tab_color.xml" value="0.1125" />
<entry key="..\:/Users/wishwa/StudioProjects/Skidndiseaseapp/app/src/main/res/layout/activity_main.xml" value="0.19270833333333334" />
<entry key="..\:/Users/wishwa/StudioProjects/Skidndiseaseapp/app/src/main/res/layout/deasisecheck.xml" value="0.22" />
<entry key="..\:/Users/wishwa/StudioProjects/Skidndiseaseapp/app/src/main/res/layout/fragment_camera.xml" value="0.1" />
<entry key="..\:/Users/wishwa/StudioProjects/Skidndiseaseapp/app/src/main/res/layout/fragment_chat.xml" value="0.12771739130434784" />
<entry key="..\:/Users/wishwa/StudioProjects/Skidndiseaseapp/app/src/main/res/layout/fragment_medc.xml" value="0.12771739130434784" />
<entry key="..\:/Users/wishwa/StudioProjects/Skidndiseaseapp/app/src/main/res/layout/fragment_search.xml" value="0.12771739130434784" />
<entry key="..\:/Users/wishwa/StudioProjects/Skidndiseaseapp/app/src/main/res/layout/fragment_search.xml" value="0.2199546485260771" />
<entry key="..\:/Users/wishwa/StudioProjects/Skidndiseaseapp/app/src/main/res/layout/frame_textview.xml" value="0.22" />
<entry key="..\:/Users/wishwa/StudioProjects/Skidndiseaseapp/app/src/main/res/menu/menu.xml" value="0.20416666666666666" />
<entry key="..\:/Users/wishwa/StudioProjects/Skidndiseaseapp/app/src/main/res/menu/search_menu.xml" value="0.22" />
</map>
</option>
</component>
......
......@@ -28,7 +28,7 @@ android {
}
dependencies {
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
......
package com.project.skidn_disease_app;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
public class DeasisAdapter extends RecyclerView.Adapter<DeasisAdapter.ViewHolder> {
View view;
Context context;
ArrayList<String> arrayList;
QuantityListner quantityListner;
ArrayList<String> arrayList_checked = new ArrayList<>();
private ArrayList<Integer> selected = new ArrayList<>();
public DeasisAdapter(Context context, ArrayList<String> arrayList, QuantityListner quantityListner) {
this.context = context;
this.arrayList = arrayList;
this.quantityListner = quantityListner;
}
public View getView() {
return view;
}
@NonNull
@Override
public DeasisAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
view = LayoutInflater.from(context).inflate(R.layout.deasisecheck,parent,false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull DeasisAdapter.ViewHolder holder, int position) {
int mLastPosition = holder.getAdapterPosition();
if(arrayList != null && arrayList.size() > 0){
holder.check_Box.setText(arrayList.get(position));
if(arrayList_checked.contains(arrayList.get(mLastPosition))){
holder.check_Box.setChecked(true);
}else{
holder.check_Box.setChecked(false);
}
holder.check_Box.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
if(holder.check_Box.isChecked()){
System.out.println(mLastPosition);
arrayList_checked.add(arrayList.get(mLastPosition));
}else{
arrayList_checked.remove(arrayList.get(mLastPosition));
}
quantityListner.onQunatiyChange(arrayList_checked
);
}
});
}
}
@Override
public int getItemCount() {
return arrayList.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
CheckBox check_Box;
public ViewHolder(@NonNull View itemView) {
super(itemView);
check_Box = itemView.findViewById(R.id.check_box);
}
}
}
package com.project.skidn_disease_app;
import java.util.ArrayList;
public interface QuantityListner {
void onQunatiyChange(ArrayList<String> arrayList);
}
<vector android:height="256dp" android:viewportHeight="24"
android:viewportWidth="24" android:width="256dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#2196f3" android:pathData="m12,0c-6.617,0 -12,5.383 -12,12s5.383,12 12,12 12,-5.383 12,-12 -5.383,-12 -12,-12z"/>
<path android:fillColor="#1d83d4" android:pathData="m12,0c-6.617,0 -12,5.383 -12,12s5.383,12 12,12z"/>
<path android:fillColor="#fff" android:pathData="m12,18.25v-3.25h-5.75c-0.689,0 -1.25,-0.561 -1.25,-1.25v-3.5c0,-0.689 0.561,-1.25 1.25,-1.25h5.75v-3.25c0,-0.66 0.795,-0.999 1.27,-0.541l6.5,6.25c0.147,0.142 0.23,0.337 0.23,0.541s-0.083,0.399 -0.23,0.541l-6.5,6.25c-0.475,0.456 -1.27,0.12 -1.27,-0.541z"/>
<path android:fillColor="#dedede" android:pathData="m5,12h15c0,0.204 -0.083,0.399 -0.23,0.541l-6.5,6.25c-0.15,0.144 -0.334,0.209 -0.514,0.209 -0.385,0 -0.756,-0.298 -0.756,-0.75v-3.25h-5.75c-0.689,0 -1.25,-0.561 -1.25,-1.25z"/>
</vector>
......@@ -5,6 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:textAlignment="center"
tools:context=".MainActivity">
<FrameLayout
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
app:cardBackgroundColor="#12251b"
android:layout_height="wrap_content">
<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:checked="false"
android:id="@+id/check_box"/>
</androidx.cardview.widget.CardView>
</RelativeLayout>
\ No newline at end of file
......@@ -4,6 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:textAlignment="center"
tools:context=".CameraFragment">
<!-- TODO: Update blank fragment layout -->
......
......@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAlignment="center"
android:background="@drawable/background"
tools:context=".ChatFragment">
......
......@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAlignment="center"
android:background="@drawable/background"
tools:context=".MedcFragment">
......
......@@ -4,17 +4,23 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:textAlignment="center"
tools:context=".SearchFragment">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<!-- TODO: Update blank fragment layout -->
<TextView
android:textSize="30dp"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_centerInParent="true"
android:textAlignment="center"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Search Now" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyleView"
android:layout_width="match_parent"
android:layout_height="672dp" />
</LinearLayout>
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:text="Button" />
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:icon="@drawable/ic_next_button"
android:id="@+id/action_search"
android:orderInCategory="1"
app:showAsAction="ifRoom"
android:title="Search"/>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#F9CC9F</color>
<color name="purple_500">#F9CC9F</color>
<color name="purple_700">#F9CC9F</color>
<color name="purple_200">#FEE3C8</color>
<color name="purple_500">#FEE3C8</color>
<color name="purple_700">#FEE3C8</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
......
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