List of usage examples for android.widget ScrollView setTag
public void setTag(final Object tag)
From source file:de.gebatzens.ggvertretungsplan.fragment.ExamFragment.java
@Override public void createView(LayoutInflater inflater, ViewGroup view) { ScrollView sv = new ScrollView(getActivity()); sv.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); sv.setTag("exam_scroll"); ((LinearLayout) view.findViewById(R.id.exam_content)).addView(sv); LinearLayout l = new LinearLayout(getActivity()); l.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); l.setOrientation(LinearLayout.VERTICAL); int p = toPixels(6); l.setPadding(p, p, p, p);//from w ww. ja v a 2 s . co m sv.addView(l); createTextView(getResources().getString(R.string.my_exams), toPixels(12), inflater, l); for (Exams.ExamItem item : GGApp.GG_APP.exams) { if (GGApp.GG_APP.filters.mainFilter.matches(item)) { CardView cv = createCardItem(item, inflater); if (cv != null) { l.addView(cv); } } } createTextView(getResources().getString(R.string.all_exams), toPixels(12), inflater, l); for (Exams.ExamItem item : GGApp.GG_APP.exams) { CardView cv = createCardItem(item, inflater); if (cv != null) { l.addView(cv); } } cardColorIndex = 0; }
From source file:de.gebatzens.sia.fragment.RemoteDataFragment.java
public View createLoadingView() { ScrollView sv = new ScrollView(getActivity()); sv.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); sv.setTag("gg_scroll"); sv.setFillViewport(true);//from ww w . j a v a 2 s. co m LinearLayout l = new LinearLayout(getActivity()); l.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); l.setGravity(Gravity.CENTER); ProgressBar pb = new ProgressBar(getActivity()); pb.getIndeterminateDrawable().setColorFilter(SIAApp.SIA_APP.school.getAccentColor(), PorterDuff.Mode.SRC_IN); pb.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); pb.setVisibility(ProgressBar.VISIBLE); l.addView(pb); sv.addView(l); return sv; }
From source file:de.gebatzens.ggvertretungsplan.fragment.MensaFragment.java
@Override public void createView(LayoutInflater inflater, ViewGroup view) { Display display = ((WindowManager) getActivity().getApplicationContext() .getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); int rotation = display.getRotation(); Log.d("Screen orientation", String.valueOf(rotation)); if ((rotation == 3) || (rotation == 1)) { screen_orientation_horizotal = true; } else {/* w w w . java 2s .c om*/ screen_orientation_horizotal = false; } final ScrollView sv = new ScrollView(getActivity()); sv.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); sv.setTag("mensa_scroll"); ((LinearLayout) view.findViewById(R.id.mensa_content)).addView(sv); final LinearLayout l = new LinearLayout(getActivity()); l.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); l.setOrientation(LinearLayout.VERTICAL); int p = toPixels(6); l.setPadding(p, p, p, p); sv.addView(l); for (Mensa.MensaItem item : GGApp.GG_APP.mensa) { if (!item.isPast()) l.addView(createCardItem(item, inflater)); } }