Skip to content

Commit

Permalink
#57 edit window menu drinkable
Browse files Browse the repository at this point in the history
  • Loading branch information
DariaZubkova authored Jul 9, 2020
1 parent b1e56b8 commit 7991991
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageButton;
Expand Down Expand Up @@ -67,6 +68,13 @@ public void onClick(View v) {
ListView lv = (ListView) findViewById(R.id.lvMain);
lv.setAdapter(sadapter);

lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(ListOfShopsActivity.this, MenuListActivity.class);
startActivity(intent);
}
});
}

@Override
Expand Down
25 changes: 13 additions & 12 deletions app/src/main/java/com/example/ubercoffee/MenuListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,37 +61,38 @@ protected void onCreate(Bundle savedInstanceState) {


Typeface typeface = ResourcesCompat.getFont(this, R.font.roboto_bold);
TypefaceSpan type = new TypefaceSpan(typeface);
//TypefaceSpan type = new TypefaceSpan(typeface);

TextView tvAdress= (TextView) findViewById(R.id.adress);
//передаем строкой адрес
final SpannableString textAdress= new SpannableString("Nevskiy Prospect, 2");
textAdress.setSpan( type, 0, textAdress.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
//textAdress.setSpan( type, 0, textAdress.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
//textAdress.se
tvAdress.setText(textAdress);

TextView tvB1= (TextView) findViewById(R.id.b1);
//передаем строкой адрес
SpannableString textB1= new SpannableString("from " + price + "₽");
textB1.setSpan( type, 0, textB1.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
//textB1.setSpan( type, 0, textB1.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
tvB1.setText(textB1);

TextView tvB3= (TextView) findViewById(R.id.b3);
//передаем строкой адрес
SpannableString textB3= new SpannableString("> " + time + " minutes");
textB3.setSpan( type, 0, textB3.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
//textB3.setSpan( type, 0, textB3.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
tvB3.setText(textB3);

TextView tvB4= (TextView) findViewById(R.id.b4);
//передаем строкой адрес
SpannableString textB4= new SpannableString(distance + " km");
textB4.setSpan( type, 0, textB4.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
//textB4.setSpan( type, 0, textB4.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
tvB4.setText(textB4);


TextView tvButton= (TextView) findViewById(R.id.textButton);
//передаем строкой адрес
final SpannableString textButton= new SpannableString("Popular");
textButton.setSpan( type, 0, textButton.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
//textButton.setSpan( type, 0, textButton.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
tvButton.setText(textButton);


Expand Down Expand Up @@ -131,11 +132,11 @@ public void onClick(View view) {
Context context = view.getContext();

Typeface typeface = ResourcesCompat.getFont(context, R.font.roboto_bold);
TypefaceSpan type = new TypefaceSpan(typeface);
//TypefaceSpan type = new TypefaceSpan(typeface);

TextView tvButton= (TextView) findViewById(R.id.textButton);
final SpannableString textButton= new SpannableString("Popular");
textButton.setSpan( type, 0, textButton.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
//textButton.setSpan( type, 0, textButton.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
tvButton.setText(textButton);

List<Drinkables> image_details = getListDataPopular();
Expand All @@ -162,11 +163,11 @@ public void onClick(View view) {
Context context = view.getContext();

Typeface typeface = ResourcesCompat.getFont(context, R.font.roboto_bold);
TypefaceSpan type = new TypefaceSpan(typeface);
//TypefaceSpan type = new TypefaceSpan(typeface);

TextView tvButton= (TextView) findViewById(R.id.textButton);
final SpannableString textButton= new SpannableString("Coffee");
textButton.setSpan( type, 0, textButton.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
//textButton.setSpan( type, 0, textButton.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
tvButton.setText(textButton);


Expand Down Expand Up @@ -195,11 +196,11 @@ public void onClick(View view) {
Context context = view.getContext();

Typeface typeface = ResourcesCompat.getFont(context, R.font.roboto_bold);
TypefaceSpan type = new TypefaceSpan(typeface);
//TypefaceSpan type = new TypefaceSpan(typeface);

TextView tvButton= (TextView) findViewById(R.id.textButton);
final SpannableString textButton= new SpannableString("Tea");
textButton.setSpan( type, 0, textButton.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
//textButton.setSpan( type, 0, textButton.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE );
tvButton.setText(textButton);


Expand Down

0 comments on commit 7991991

Please sign in to comment.