Back to project page android_app.
The source code is released under:
Apache License
If you think the Android project android_app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package models; /*// w ww .j ava 2 s .c o m ~ ******************************************************************************* ~ Copyright (c) 2013-2014 Daniel Lin, Kamal Chaya, Sean Penney, and Daniel Chuang ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. ~ ***************************************************************************** */ import java.util.List; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.example.t_danbubbletea.R; import it.gmariotti.cardslib.library.internal.CardExpand; public class CardDiscountAndCheckoutFormat extends CardExpand { int count; public CardDiscountAndCheckoutFormat(Context context) { super(context, R.layout.inner_layout); } public CardDiscountAndCheckoutFormat(Context context,int i) { super(context, R.layout.inner_layout); count = i; // get card index } @Override public void setupInnerViewElements(ViewGroup parent, View view) { MySQLiteHelper db = new MySQLiteHelper(parent.getContext()); List<TeaData> teaList = db.getAllTeas(); TeaData tea = null; tea = teaList.get(count); if (view == null){ return; } // set tea details (tea flavors, price, milk type, and tea type) in the drop // down menu of the card TextView teaDataView1 = (TextView) view.findViewById(R.id.inner_simple_title); teaDataView1.setText("Price:"+ "" + tea.getPrice()); TextView teaDataView2 = (TextView) view.findViewById(R.id.inner_simple_title2); teaDataView2.setText(tea.getFlavor()); TextView teaDataView3 = (TextView) view.findViewById(R.id.inner_simple_title3); teaDataView3.setText(tea.getMilk()); TextView teaDataView4 = (TextView) view.findViewById(R.id.inner_simple_title4); teaDataView4.setText(tea.getType()); } }