|
@@ -0,0 +1,143 @@
|
|
|
|
|
+package com.usai.ratradefiling.home;
|
|
|
|
|
+
|
|
|
|
|
+import android.content.Intent;
|
|
|
|
|
+import android.os.Bundle;
|
|
|
|
|
+
|
|
|
|
|
+//import androidx.fragment.app.Fragment;
|
|
|
|
|
+
|
|
|
|
|
+import android.view.View;
|
|
|
|
|
+import android.widget.ListView;
|
|
|
|
|
+
|
|
|
|
|
+import com.usai.ratradefiling.R;
|
|
|
|
|
+import com.usai.redant.rautils.list.StaticModelistFragment;
|
|
|
|
|
+
|
|
|
|
|
+import org.json.JSONObject;
|
|
|
|
|
+
|
|
|
|
|
+///**
|
|
|
|
|
+// * A simple {@link Fragment} subclass.
|
|
|
|
|
+// * Use the {@link CompanySelectFragment#newInstance} factory method to
|
|
|
|
|
+// * create an instance of this fragment.
|
|
|
|
|
+// */
|
|
|
|
|
+public class CompanySelectFragment extends StaticModelistFragment
|
|
|
|
|
+{
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ public CompanySelectFragment()
|
|
|
|
|
+ {
|
|
|
|
|
+ // Required empty public constructor
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onActivityCreated(Bundle savedInstanceState)
|
|
|
|
|
+ {
|
|
|
|
|
+ super.onActivityCreated(savedInstanceState);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject json;
|
|
|
|
|
+ Intent i=getActivity().getIntent();
|
|
|
|
|
+ json=i.getBundleExtra("");
|
|
|
|
|
+
|
|
|
|
|
+ setupAdapter(json);
|
|
|
|
|
+
|
|
|
|
|
+// adapter.getView()
|
|
|
|
|
+
|
|
|
|
|
+ customize_style();
|
|
|
|
|
+// JSONObject jsonobj=loadjson(R.raw.search);
|
|
|
|
|
+// adapter = new SimpleRoundCornerAdapter(this.getActivity(),
|
|
|
|
|
+// getData(jsonobj), R.layout.static_modelist_cell, new String[] { "title",
|
|
|
|
|
+// "img","detail" }, new int[] { R.id.tv_name, R.id.iv_icon,R.id.tv_detail });
|
|
|
|
|
+// setListAdapter(adapter);
|
|
|
|
|
+//// this.getListView().setDivider(R.drawable.);
|
|
|
|
|
+// this.getListView().setDividerHeight(18);
|
|
|
|
|
+// this.getListView().setBackgroundColor(Color.WHITE);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onListItemClick(ListView l, View v, int position, long id)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+// JSONObject jsonobj=loadjson(R.raw.my);
|
|
|
|
|
+// Log.d("FragmentList", "Item clicked: " + id);
|
|
|
|
|
+//
|
|
|
|
|
+// String title = (String) getData(jsonobj).get(position-1).get("title");
|
|
|
|
|
+//
|
|
|
|
|
+//// Intent intent = new Intent();
|
|
|
|
|
+// if (title.equals("Saved Detail"))
|
|
|
|
|
+// {
|
|
|
|
|
+//
|
|
|
|
|
+// if(true)
|
|
|
|
|
+// throw new AssertionError("not impl");
|
|
|
|
|
+//// Intent intent = new Intent();
|
|
|
|
|
+//// intent.setClass(getActivity(), CheckSavedActivity.class);
|
|
|
|
|
+//// // intent.putExtra("user", ApexTrackingApplication.get_user());
|
|
|
|
|
+//// // intent.putExtra("password", password);
|
|
|
|
|
+//// intent.putExtra("function_name", "Saved Detail");
|
|
|
|
|
+////// intent.putExtra("title", "Booking Search");
|
|
|
|
|
+//// startActivity(intent);
|
|
|
|
|
+// }
|
|
|
|
|
+// else if (title.equals("Saved Search"))
|
|
|
|
|
+// {
|
|
|
|
|
+//
|
|
|
|
|
+// if(true)
|
|
|
|
|
+// throw new AssertionError("not impl");
|
|
|
|
|
+////
|
|
|
|
|
+//// Intent intent = new Intent();
|
|
|
|
|
+//// intent.setClass(getActivity(), CheckSavedActivity.class);
|
|
|
|
|
+//// // intent.putExtra("user", user);
|
|
|
|
|
+//// // intent.putExtra("password", password);
|
|
|
|
|
+//// intent.putExtra("function_name", "Saved Search");
|
|
|
|
|
+////// intent.putExtra("title", "B/L info. Search");
|
|
|
|
|
+//// startActivity(intent);
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+//// else if(title.equals("Saved Documents"))
|
|
|
|
|
+//// {
|
|
|
|
|
+////// Intent intent = new Intent();
|
|
|
|
|
+////// intent.setClass(getActivity(), LocalDocumentActivity.class);
|
|
|
|
|
+//////// intent.putExtra("module_name", "Announcements");
|
|
|
|
|
+////// startActivity(intent);
|
|
|
|
|
+////
|
|
|
|
|
+//// Intent intent = new Intent();
|
|
|
|
|
+//// intent.setClass(getActivity(), CheckSavedActivity.class);
|
|
|
|
|
+//// intent.putExtra("function_name", "Saved Documents");
|
|
|
|
|
+////
|
|
|
|
|
+//// startActivity(intent);
|
|
|
|
|
+////
|
|
|
|
|
+//// }
|
|
|
|
|
+// else if (title.equals("Change Password"))
|
|
|
|
|
+// {
|
|
|
|
|
+//
|
|
|
|
|
+// if(true)
|
|
|
|
|
+// throw new AssertionError("not impl");
|
|
|
|
|
+//// Intent intent = new Intent();
|
|
|
|
|
+//// intent.setClass(getActivity(), ChangePasswordActivity.class);
|
|
|
|
|
+////
|
|
|
|
|
+//// startActivityForResult(intent, REQUEST_CHANGEPASSWORD_ACTIVITY);
|
|
|
|
|
+//// return;
|
|
|
|
|
+// }
|
|
|
|
|
+// else if (title.equals("Logout"))
|
|
|
|
|
+// {
|
|
|
|
|
+//
|
|
|
|
|
+// String UNIQUE_STRING = "com.usai.apex.push.cancel";
|
|
|
|
|
+// Intent intent = new Intent(UNIQUE_STRING);
|
|
|
|
|
+// // intent.putExtra("key1", "value1");
|
|
|
|
|
+// // intent.putExtra("key2", "value2");
|
|
|
|
|
+// intent.setPackage( getActivity().getPackageName());
|
|
|
|
|
+// getActivity().sendBroadcast(intent);
|
|
|
|
|
+// if(mCallBack!=null)
|
|
|
|
|
+// mCallBack.onLogout();
|
|
|
|
|
+//
|
|
|
|
|
+// {
|
|
|
|
|
+//
|
|
|
|
|
+// Intent bintent = new Intent("Login");
|
|
|
|
|
+// bintent.putExtra("state", false);
|
|
|
|
|
+// LocalBroadcastManager.getInstance(getActivity())
|
|
|
|
|
+// .sendBroadcast(bintent);
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+}
|