Explorar o código

1.完成Android Apex Drivers Order Filter界面。

Pen Li %!s(int64=7) %!d(string=hai) anos
pai
achega
68fee2f129

+ 36 - 45
ApexDrivers/app/src/main/AndroidManifest.xml

@@ -2,14 +2,11 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
           package="com.usai.redant.apexdrivers">
 
-
     <!-- External storage for log and cache. -->
     <!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> -->
     <!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> -->
 
-    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
-
-
+    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
     <uses-permission android:name="android.permission.CAMERA"/>
     <uses-permission android:name="android.permission.WAKE_LOCK"/>
     <uses-permission android:name="android.permission.VIBRATE"/>
@@ -21,7 +18,6 @@
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
 
-
     <application
         android:name=".ApexDriverApplication"
         android:allowBackup="true"
@@ -41,71 +37,66 @@
             </intent-filter>
         </activity>
 
-
         <service
             android:name=".ApexDriversBackgroundService"
             android:enabled="true"
-            android:exported="true" />
-
+            android:exported="true"/>
 
         <receiver
             android:name=".Receiver.ApexDriverBootCompleteReceiver"
             android:directBootAware="true"
             android:enabled="true"
             android:exported="false"
-            android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
-            >
+            android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
             <intent-filter>
-                <action android:name="android.intent.action.BOOT_COMPLETED" />
-                <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
+                <action android:name="android.intent.action.BOOT_COMPLETED"/>
+                <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED"/>
             </intent-filter>
-
         </receiver>
 
-        <activity android:name=".Detail.DetailActivity"
-                  android:screenOrientation="portrait">
+        <activity
+            android:name=".Detail.DetailActivity"
+            android:screenOrientation="portrait">
         </activity>
-        <activity android:name=".Update.UpdateActivity"
-                  android:screenOrientation="portrait">
+        <activity
+            android:name=".Update.UpdateActivity"
+            android:screenOrientation="portrait">
         </activity>
-        <activity android:name=".camera.PreferencesActivity"
-                  android:screenOrientation="portrait">
+        <activity
+            android:name=".camera.PreferencesActivity"
+            android:screenOrientation="portrait">
         </activity>
-        <activity android:name=".CodeScanner.CaptureActivity"
-                  android:clearTaskOnLaunch="true"
-                  android:label="Scan"
-                  android:screenOrientation="sensorLandscape"
-                  android:stateNotNeeded="true"
-                  android:theme="@style/CaptureTheme"
-                  android:windowSoftInputMode="stateAlwaysHidden">
+        <activity
+            android:name=".CodeScanner.CaptureActivity"
+            android:clearTaskOnLaunch="true"
+            android:label="Scan"
+            android:screenOrientation="sensorLandscape"
+            android:stateNotNeeded="true"
+            android:theme="@style/CaptureTheme"
+            android:windowSoftInputMode="stateAlwaysHidden">
         </activity>
-        <activity android:name=".Update.PhotoPreviewActivity"
-                  android:screenOrientation="portrait">
+        <activity
+            android:name=".Update.PhotoPreviewActivity"
+            android:screenOrientation="portrait">
         </activity>
-        <activity android:name=".Login.RetrievePasswordActivity"
-                  android:screenOrientation="portrait">
+        <activity
+            android:name=".Login.RetrievePasswordActivity"
+            android:screenOrientation="portrait">
         </activity>
-
         <activity
             android:name=".Home.HomeMoreActivity"
-            android:screenOrientation="portrait"
-                  >
-
+            android:screenOrientation="portrait">
         </activity>
-
         <activity
             android:name=".Upload.UploadListActivity"
-            android:screenOrientation="portrait"
-                  >
-
+            android:screenOrientation="portrait">
         </activity>
-
-        <activity android:name=".Upload.TaskActivity"
-                  android:screenOrientation="portrait"
-            >
-
+        <activity
+            android:name=".Upload.TaskActivity"
+            android:screenOrientation="portrait">
+        </activity>
+        <activity android:name=".Filter.OrderFilterActivity">
         </activity>
-
     </application>
 
-</manifest>
+</manifest>

+ 337 - 0
ApexDrivers/app/src/main/java/com/usai/redant/apexdrivers/Filter/OrderFilterActivity.java

@@ -0,0 +1,337 @@
+package com.usai.redant.apexdrivers.Filter;
+
+import android.content.Context;
+import android.content.Intent;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AlertDialog;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ExpandableListView;
+
+import com.usai.redant.apexdrivers.R;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+
+public class OrderFilterActivity extends AppCompatActivity {
+
+    private static final String OrderFilterKey = "OrderFilterKey";
+    private static final String OrderFilterSavedKey = "OrderFilterSavedKey";
+
+    public static Intent filterActivityIntent(Context ctx, JSONObject filter) {
+
+        if (ctx == null) {
+            return null;
+        }
+
+        if (filter.length() == 0) {
+            new AlertDialog.Builder(ctx)
+                    .setTitle("Warning")
+                    .setMessage("There is no filter data")
+                    .setPositiveButton("Ok",null)
+                    .show();
+            return null;
+        }
+
+        Intent intent = new Intent(ctx,OrderFilterActivity.class);
+        intent.putExtra(OrderFilterKey,filter.toString());
+
+        return intent;
+    }
+
+    private Context mCtx = this;
+    private ExpandableListView mFilterListView;
+    private JSONObject mFilter;
+    private OrderFilterAdapter mAdapter;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_order_filter);
+
+        ActionBar actionBar = getSupportActionBar();
+        if (actionBar != null) {
+            actionBar.setHomeButtonEnabled(true);
+            actionBar.setDisplayHomeAsUpEnabled(true);
+        }
+
+        mFilterListView = findViewById(R.id.order_filter_listView);
+        mFilterListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
+            @Override
+            public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
+                return false;
+            }
+        });
+
+        mFilter = null;
+        if (getIntent() != null) {
+            String filterStr = getIntent().getStringExtra(OrderFilterKey);
+            if (filterStr != null && filterStr.length() > 0) {
+                try {
+                    mFilter = new JSONObject(filterStr);
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                    mFilter = null;
+                }
+            } else {
+                mFilter = null;
+            }
+        }
+
+        if (savedInstanceState != null) {
+            String filterStr = savedInstanceState.getString(OrderFilterSavedKey);
+            if (filterStr != null && filterStr.length() > 0) {
+                try {
+                    mFilter = new JSONObject(filterStr);
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                    mFilter = null;
+                }
+            } else {
+                mFilter = null;
+            }
+        }
+
+        prepareData();
+
+        mFilterListView.setAdapter(mAdapter);
+    }
+
+    @Override
+    protected void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+
+        if (mFilter != null) {
+            outState.putString(OrderFilterSavedKey,mFilter.toString());
+        }
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+            case android.R.id.home: {
+                finish();
+                return true;
+            }
+        }
+
+        return super.onOptionsItemSelected(item);
+    }
+
+    /**
+     * Data
+     * */
+    private void prepareData() {
+
+        ArrayList<SectionModel> sectionModels = new ArrayList<>();
+
+        if (mFilter != null) {
+            JSONArray sections = mFilter.optJSONArray("sections");
+            for (int i = 0; i < sections.length(); i++) {
+
+                JSONObject section = sections.optJSONObject(i);
+                if (section != null) {
+
+                    SectionModel model = new SectionModel();
+                    model.setValuesWithJsonObject(section);
+
+                    sectionModels.add(model);
+                }
+
+            }
+        }
+
+        mAdapter = new OrderFilterAdapter(mCtx,sectionModels);
+    }
+
+    /**
+     * Model
+     * */
+
+    public static class SectionModel {
+        public String title;
+        public String key;
+        public ArrayList<BaseModel> values = new ArrayList<>();
+
+        public void setValuesWithJsonObject(JSONObject jsonObject) {
+            if (jsonObject != null) {
+
+                title = jsonObject.optString("title");
+                key = jsonObject.optString("key");
+                JSONArray values = jsonObject.optJSONArray("values");
+                setValues(values);
+            }
+        }
+
+        public void setValues(JSONArray values) {
+
+            this.values.clear();
+
+            if (values == null) {
+                return;
+            }
+
+            for (int i = 0; i < values.length(); i++) {
+                JSONObject value = values.optJSONObject(i);
+                if (value != null) {
+                    int type = value.optInt("type");
+                    switch (type) {
+                        case ModelTypeStatus: {
+                            StatusModel model = new StatusModel();
+                            model.setValuesWithJsonObject(value);
+
+                            this.values.add(model);
+                        }
+                        break;
+                        case ModelTypeDate: {
+                            DateModel model = new DateModel();
+                            model.setValuesWithJsonObject(value);
+
+                            this.values.add(model);
+                        }
+                        break;
+                        case ModelTypeInput: {
+                            InputModel model = new InputModel();
+                            model.setValuesWithJsonObject(value);
+
+                            this.values.add(model);
+                        }
+                        break;
+
+                    }
+                }
+            }
+
+        }
+
+        public BaseModel modelForRow(int row) {
+            return values.get(row);
+        }
+    }
+
+    public static final int ModelTypeStatus = 0;
+    public static final int ModelTypeInput = 1;
+    public static final int ModelTypeDate = 2;
+
+    public interface ModelDelegate {
+        void refreshUI();
+    }
+
+    public static class BaseModel {
+
+        public int type;
+        public ModelDelegate delegate;
+
+        public void setValuesWithJsonObject(JSONObject object) {
+            if (object != null) {
+                type = object.optInt("type");
+            }
+
+        }
+
+    }
+
+    public static class DateModel extends BaseModel {
+
+        public String from,to;
+
+        @Override
+        public void setValuesWithJsonObject(JSONObject object) {
+            super.setValuesWithJsonObject(object);
+
+            if (object != null) {
+                setFrom(object.optString("from"));
+                setTo(object.optString("to"));
+            } else {
+                setFrom(null);
+                setTo(null);
+            }
+        }
+
+        public void setFrom(String from) {
+            this.from = from;
+
+            if (delegate != null) {
+                delegate.refreshUI();
+            }
+        }
+
+        public void setTo(String to) {
+            this.to = to;
+
+            if (delegate != null) {
+                delegate.refreshUI();
+            }
+        }
+    }
+
+    public static class InputModel extends BaseModel {
+
+        public String value;
+        @Override
+        public void setValuesWithJsonObject(JSONObject object) {
+            super.setValuesWithJsonObject(object);
+
+            if (object != null) {
+                setValue(object.optString("value"));
+            } else {
+                setValue(null);
+            }
+        }
+
+        public void setValue(String value) {
+            this.value = value;
+
+            if (delegate != null) {
+                delegate.refreshUI();
+            }
+        }
+
+        public void updateValue(String value) {
+            this.value = value;
+        }
+    }
+
+    public static class StatusModel extends BaseModel {
+
+        public String value;
+        public boolean selected;
+
+        @Override
+        public void setValuesWithJsonObject(JSONObject object) {
+            super.setValuesWithJsonObject(object);
+
+            if (object != null) {
+                setValue(object.optString("value"));
+            } else {
+                setValue(null);
+            }
+        }
+
+        public void setValue(String value) {
+            this.value = value;
+
+            if (delegate != null) {
+                delegate.refreshUI();
+            }
+        }
+
+        public void setSelected(boolean selected) {
+            this.selected = selected;
+
+            if (delegate != null) {
+                delegate.refreshUI();
+            }
+        }
+    }
+
+    /**
+     * Adapter
+     * */
+
+}

+ 264 - 0
ApexDrivers/app/src/main/java/com/usai/redant/apexdrivers/Filter/OrderFilterAdapter.java

@@ -0,0 +1,264 @@
+package com.usai.redant.apexdrivers.Filter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseExpandableListAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.usai.redant.apexdrivers.R;
+
+import java.util.ArrayList;
+
+import static com.usai.redant.apexdrivers.Filter.OrderFilterActivity.ModelTypeDate;
+import static com.usai.redant.apexdrivers.Filter.OrderFilterActivity.ModelTypeInput;
+import static com.usai.redant.apexdrivers.Filter.OrderFilterActivity.ModelTypeStatus;
+
+public class OrderFilterAdapter extends BaseExpandableListAdapter {
+
+    private Context mCtx;
+    private ArrayList<OrderFilterActivity.SectionModel> mSections;
+
+    OrderFilterAdapter(Context context, ArrayList<OrderFilterActivity.SectionModel> sections) {
+        mCtx = context;
+        mSections = sections;
+    }
+
+    @Override
+    public int getGroupCount() {
+        if (mSections == null) {
+            return 0;
+        }
+        return mSections.size();
+    }
+
+    @Override
+    public int getChildrenCount(int groupPosition) {
+
+        OrderFilterActivity.SectionModel sectionModel = mSections.get(groupPosition);
+
+        return sectionModel.values.size();
+    }
+
+    @Override
+    public Object getGroup(int groupPosition) {
+
+        OrderFilterActivity.SectionModel sectionModel = mSections.get(groupPosition);
+
+        return sectionModel;
+    }
+
+    @Override
+    public Object getChild(int groupPosition, int childPosition) {
+
+        OrderFilterActivity.SectionModel sectionModel = mSections.get(groupPosition);
+
+        return sectionModel.modelForRow(childPosition);
+    }
+
+    @Override
+    public long getGroupId(int groupPosition) {
+        return groupPosition;
+    }
+
+    @Override
+    public long getChildId(int groupPosition, int childPosition) {
+        return childPosition;
+    }
+
+    @Override
+    public boolean hasStableIds() {
+        return false;
+    }
+
+    @Override
+    public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
+
+        HeaderHolder holder = null;
+        if (convertView == null) {
+            convertView = LayoutInflater.from(mCtx).inflate(R.layout.filter_header,null);
+            holder = new HeaderHolder(convertView);
+        } else {
+            holder = (HeaderHolder)convertView.getTag();
+        }
+
+        OrderFilterActivity.SectionModel model = mSections.get(groupPosition);
+        holder.titleTv.setText(model.title);
+
+        return convertView;
+    }
+
+    @Override
+    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
+
+        OrderFilterActivity.SectionModel sectionModel = mSections.get(groupPosition);
+
+        OrderFilterActivity.BaseModel model = sectionModel.modelForRow(childPosition);
+
+        switch (model.type) {
+            case ModelTypeStatus: {
+
+                StatusHolder holder = null;
+                if (convertView == null) {
+                    convertView = LayoutInflater.from(mCtx).inflate(R.layout.filter_status_cell,null);
+                    holder = new StatusHolder(convertView);
+                } else {
+                    holder = (StatusHolder)convertView.getTag();
+                }
+
+                holder.setModel(model);
+            }
+            break;
+            case ModelTypeInput: {
+
+                InputHolder holder = null;
+                if (convertView == null) {
+                    convertView = LayoutInflater.from(mCtx).inflate(R.layout.filter_input_cell,null);
+                    holder = new InputHolder(convertView);
+                } else {
+                    holder = (InputHolder)convertView.getTag();
+                }
+                holder.setModel(model);
+            }
+            break;
+            case ModelTypeDate: {
+
+                DateHolder holder = null;
+                if (convertView == null) {
+                    convertView = LayoutInflater.from(mCtx).inflate(R.layout.filter_date_cell,null);
+                    holder = new DateHolder(convertView);
+                } else {
+                    holder = (DateHolder)convertView.getTag();
+                }
+                holder.setModel(model);
+            }
+            break;
+        }
+
+        return convertView;
+    }
+
+    @Override
+    public boolean isChildSelectable(int groupPosition, int childPosition) {
+        return true;
+    }
+
+    @Override
+    public int getChildTypeCount() {
+        return 3;
+    }
+
+    @Override
+    public int getChildType(int groupPosition, int childPosition) {
+        OrderFilterActivity.BaseModel model = (OrderFilterActivity.BaseModel) getChild(groupPosition,childPosition);
+        return model.type;
+    }
+
+    private class HeaderHolder {
+
+        TextView titleTv;
+
+        HeaderHolder(View view) {
+
+            titleTv = view.findViewById(R.id.filter_header_tv);
+            view.setTag(this);
+        }
+    }
+
+    private class BaseHolder implements OrderFilterActivity.ModelDelegate{
+        public OrderFilterActivity.BaseModel model;
+
+        public void setModel(OrderFilterActivity.BaseModel model) {
+            if (this.model != null) {
+                this.model.delegate = null;
+            }
+            this.model = model;
+            if (this.model != null) {
+                this.model.delegate = this;
+            }
+
+            refreshUI();
+        }
+
+        @Override
+        public void refreshUI() {
+
+        }
+    }
+
+    private class DateHolder extends BaseHolder {
+
+        Button fromBtn,toBtn;
+
+        DateHolder(View view) {
+
+            fromBtn = view.findViewById(R.id.filter_date_from_btn);
+            toBtn = view.findViewById(R.id.filter_date_to_btn);
+            view.setTag(this);
+        }
+
+        @Override
+        public void refreshUI() {
+            super.refreshUI();
+
+            OrderFilterActivity.DateModel model = (OrderFilterActivity.DateModel)this.model;
+            String from = model.from;
+            if (from == null || from.length() == 0) {
+                from = "";
+            }
+            fromBtn.setText(from);
+
+            String to = model.to;
+            if (to == null || to.length() == 0) {
+                to = "";
+            }
+            toBtn.setText(to);
+        }
+    }
+
+    private class InputHolder extends BaseHolder {
+
+        EditText inputText;
+        InputHolder(View view) {
+
+            inputText = view.findViewById(R.id.filter_input_tv);
+            view.setTag(this);
+        }
+
+        @Override
+        public void refreshUI() {
+            super.refreshUI();
+
+            OrderFilterActivity.InputModel model = (OrderFilterActivity.InputModel)this.model;
+
+            inputText.setText(model.value);
+        }
+    }
+
+    private class StatusHolder extends BaseHolder {
+
+        TextView valueTv;
+        ImageView selectionView;
+
+        StatusHolder(View view) {
+
+            valueTv = view.findViewById(R.id.filter_status_title_tv);
+            selectionView = view.findViewById(R.id.filter_status_selection_view);
+            view.setTag(this);
+        }
+
+        @Override
+        public void refreshUI() {
+            super.refreshUI();
+
+            OrderFilterActivity.StatusModel model = (OrderFilterActivity.StatusModel)this.model;
+
+            valueTv.setText(model.value);
+            selectionView.setVisibility(model.selected ? View.VISIBLE : View.GONE);
+        }
+    }
+}

+ 33 - 0
ApexDrivers/app/src/main/java/com/usai/redant/apexdrivers/Home/HomeMoreActivity.java

@@ -15,6 +15,7 @@ import android.os.Bundle;
 import android.text.TextUtils;
 import android.view.Gravity;
 import android.view.LayoutInflater;
+import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
@@ -25,6 +26,7 @@ import android.widget.ListView;
 import android.widget.TextView;
 
 import com.usai.redant.apexdrivers.Detail.DetailActivity;
+import com.usai.redant.apexdrivers.Filter.OrderFilterActivity;
 import com.usai.redant.apexdrivers.R;
 import com.usai.redant.rautils.Utils.Network;
 
@@ -47,6 +49,9 @@ public class HomeMoreActivity extends AppCompatActivity implements AbsListView.O
     private final static String SavedOrderTypeKey = "SavedOrderTypeKey";
     private final static String SavedTitleKey = "SavedTitleKey";
 
+
+    private final static int REQUEST_ORDER_FILTER_CODE = 0;
+
     public static Intent build(Context context, int orderType, String title) {
 
         if (context == null) {
@@ -74,6 +79,7 @@ public class HomeMoreActivity extends AppCompatActivity implements AbsListView.O
     private int mType;
     private String mTitle;
     private HomeOrderModel mSelectedModel;
+    private JSONObject mFilter;
 
 
     @Override
@@ -139,10 +145,22 @@ public class HomeMoreActivity extends AppCompatActivity implements AbsListView.O
                 finish();
                 return true;
             }
+            case R.id.filter_btn: {
+                showFilter();
+                return true;
+            }
         }
         return super.onOptionsItemSelected(item);
     }
 
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+
+        getMenuInflater().inflate(R.menu.order_filter_menu,menu);
+
+        return true;
+    }
+
     @Override
     protected void onSaveInstanceState(Bundle outState) {
         super.onSaveInstanceState(outState);
@@ -158,6 +176,14 @@ public class HomeMoreActivity extends AppCompatActivity implements AbsListView.O
 
     }
 
+    private void showFilter() {
+
+        mFilter = com.usai.redant.apexdrivers.Network.Network.loadFakeData(this,R.raw.fake_order_filter);
+        Intent intent = OrderFilterActivity.filterActivityIntent(mContext,mFilter);
+
+        startActivityForResult(intent,REQUEST_ORDER_FILTER_CODE);
+    }
+
     private String prepareOrderForSave() {
 
         try {
@@ -191,6 +217,10 @@ public class HomeMoreActivity extends AppCompatActivity implements AbsListView.O
             JSONObject json = new JSONObject();
             json.put("orders",orders);
 
+            if (mFilter != null) {
+                json.put("filter",mFilter);
+            }
+
             return json.toString();
 
         } catch (JSONException e) {
@@ -356,6 +386,9 @@ public class HomeMoreActivity extends AppCompatActivity implements AbsListView.O
     private void handleJson(JSONObject json, int option) {
 
         if (json != null) {
+
+            mFilter = json.optJSONObject("filter");
+
             JSONArray orders = json.optJSONArray("orders");
             if (orders != null) {
                 if (option != LoadDataOptionLoadMore) {

+ 1 - 1
ApexDrivers/app/src/main/java/com/usai/redant/apexdrivers/Network/Network.java

@@ -322,7 +322,7 @@ public class Network extends com.usai.redant.rautils.Utils.Network {
         getJson(URL_REPORT_LOCATION,params);
     }
 
-    private static JSONObject loadFakeData(Context context, int rawId) {
+    public static JSONObject loadFakeData(Context context, int rawId) {
 
         try
         {

BIN=BIN
ApexDrivers/app/src/main/res/drawable/checkmark.png


BIN=BIN
ApexDrivers/app/src/main/res/drawable/filter.png


+ 20 - 0
ApexDrivers/app/src/main/res/layout/activity_order_filter.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.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:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".Filter.OrderFilterActivity">
+
+    <ExpandableListView
+        android:id="@+id/order_filter_listView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:groupIndicator="@null"
+        >
+
+
+    </ExpandableListView>
+
+</android.support.constraint.ConstraintLayout>

+ 31 - 0
ApexDrivers/app/src/main/res/layout/filter_date_cell.xml

@@ -0,0 +1,31 @@
+<?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="50dp">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="horizontal"
+        >
+
+        <Button
+            android:id="@+id/filter_date_from_btn"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:layout_margin="5dp"
+            />
+        <Button
+            android:id="@+id/filter_date_to_btn"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:layout_margin="5dp"
+            />
+
+
+    </LinearLayout>
+
+</RelativeLayout>

+ 13 - 0
ApexDrivers/app/src/main/res/layout/filter_header.xml

@@ -0,0 +1,13 @@
+<?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="match_parent">
+
+    <TextView
+        android:id="@+id/filter_header_tv"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_margin="5dp"
+        />
+
+</RelativeLayout>

+ 13 - 0
ApexDrivers/app/src/main/res/layout/filter_input_cell.xml

@@ -0,0 +1,13 @@
+<?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="50dp">
+
+    <EditText
+        android:id="@+id/filter_input_tv"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_margin="5dp"
+        />
+
+</RelativeLayout>

+ 23 - 0
ApexDrivers/app/src/main/res/layout/filter_status_cell.xml

@@ -0,0 +1,23 @@
+<?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="50dp">
+
+    <TextView
+        android:id="@+id/filter_status_title_tv"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_margin="5dp"
+        />
+    
+    <ImageView
+        android:id="@+id/filter_status_selection_view"
+        android:layout_width="40dp"
+        android:layout_height="40dp"
+        android:layout_centerVertical="true"
+        android:layout_marginRight="5dp"
+        android:layout_alignParentRight="true"
+        android:src="@drawable/checkmark"
+        />
+    
+</RelativeLayout>

+ 12 - 0
ApexDrivers/app/src/main/res/menu/order_filter_menu.xml

@@ -0,0 +1,12 @@
+<?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:id="@+id/filter_btn"
+        app:showAsAction="always"
+        android:title=""
+        android:icon="@drawable/filter"
+        ></item>
+
+</menu>

+ 61 - 0
ApexDrivers/app/src/main/res/raw/fake_order_filter.json

@@ -0,0 +1,61 @@
+{
+    "sections": [
+                 {
+                 "title": "Order Status",
+                 "values": [
+                            {
+                            "type": 0,
+                            "value": "New Order"
+                            },
+                            {
+                            "type": 0,
+                            "value": "PickUp Order"
+                            },
+                            {
+                            "type": 0,
+                            "value": "Delivered"
+                            },
+                            {
+                            "type": 0,
+                            "value": "Cancel"
+                            },
+                            {
+                            "type": 0,
+                            "value": "Return"
+                            }
+                            ],
+                 "key": "status"
+                 },
+                 {
+                 "title": "Order ID",
+                 "values": [
+                            {
+                            "type": 1,
+                            "value": ""
+                            }
+                            ],
+                 "key": "order_id"
+                 },
+                 {
+                 "title": "Container No.",
+                 "values": [
+                            {
+                            "type": 1,
+                            "value": ""
+                            }
+                            ],
+                 "key": "container_no"
+                 },
+                 {
+                 "title": "Date",
+                 "values": [
+                            {
+                            "type": 2,
+                            "from": "",
+                            "to": ""
+                            }
+                            ],
+                 "key": "date"
+                 }
+                 ]
+}