This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onKitchenOrdersReceived(KitchenOrdersResponse mKitchenOrdersResponse) | |
{ | |
AppLog.d(TAG, "onKitchenOrdersReceived"); | |
this.mKitchenOrdersResponse = mKitchenOrdersResponse; | |
mAdapter = new OrdersAdapter(mKitchenOrdersResponse); | |
recyclerView.setAdapter(mAdapter); | |
ItemTouchHelper.Callback callback = new ItemTouchHelperCallback(mAdapter); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt" | |
android:viewportWidth="640" | |
android:viewportHeight="480" | |
android:width="640dp" | |
android:height="480dp"> | |
<path | |
android:pathData="M2.50002 0.499998H639.5V477.5H2.50002V0.499998Z" | |
android:strokeColor="#000000" | |
android:strokeWidth="20" /> | |
<group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainFragment : Fragment(), ItemListener{ | |
companion object { | |
private const val TAG = "MainFragment" | |
} | |
private var _binding: FragmentMainBinding? = null | |
private val binding get() = _binding!! | |
private var mActivity : MainActivity? = null | |
var mView: View? = null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ItemListener { | |
fun onViewCard(position: Int) | |
fun onRemoveCard(position: Int) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ParentItemsAdapter(private val data: List<ParentItemModel>, | |
private var itemListener: ItemListener | |
) : RecyclerView.Adapter<ParentItemsViewHolder>() { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ParentItemsViewHolder { | |
val inflater = LayoutInflater.from(parent.context) | |
return ParentItemsViewHolder( | |
inflater, | |
parent, | |
itemListener |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ParentItemsViewHolder(inflater: LayoutInflater, parent: ViewGroup, itemListener: ItemListener) : | |
RecyclerView.ViewHolder(inflater.inflate(R.layout.card_parent_item, parent, false)) { | |
private var itemListener: ItemListener? = null | |
private var cardTitle: TextView? = null | |
private var recyclerItem: RecyclerView? = null | |
init { | |
cardTitle = itemView.findViewById(R.id.app_title) | |
recyclerItem = itemView.findViewById(R.id.id_card_child_items) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChildItemsAdapter(private val data: ArrayList<ChildItemModel>, | |
private var itemListener: ItemListener | |
) : RecyclerView.Adapter<ChildItemsViewHolder>(), ItemListener { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ChildItemsViewHolder { | |
val inflater = LayoutInflater.from(parent.context) | |
return ChildItemsViewHolder(inflater, parent, this) | |
} | |
override fun onBindViewHolder(holder: ChildItemsViewHolder, position: Int) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChildItemsViewHolder(inflater: LayoutInflater, parent: ViewGroup, itemListener: ItemListener) : | |
RecyclerView.ViewHolder(inflater.inflate(R.layout.card_child_item, parent, false)), View.OnClickListener { | |
private var itemListener: ItemListener? = null | |
private var cardTitle: TextView? = null | |
private var cardDesc: TextView? = null | |
private var remove: ConstraintLayout? = null | |
init { | |
cardTitle = itemView.findViewById(R.id.card_title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OkHttpFactory { | |
private static final int DEFAULT_CONNECTION_TIMEOUT = 30; // seconds | |
private OkHttpClient mOkHttpClient; | |
public void OkHttpFactory() { | |
mOkHttpClient = new OkHttpClient(); | |
} | |
/** | |
* To get default OkHttpClient with out any interceptor or log level. To add OkHttpClient with its properties use {@link Builder} class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LauncherActivity : AppCompatActivity(){ | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val handler = Handler() | |
setContentView(R.layout.activity_launcher) | |
val updates = listOf( | |
UpdatesSeriesModel( |
OlderNewer