use of android.view.LayoutInflater in project Rutgers-Course-Tracker by tevjef.
the class ChooserFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
LayoutInflater themedInflator = inflater.cloneInContext(Utils.wrapContextTheme(getActivity(), R.style.RutgersCT));
final View rootView = themedInflator.inflate(R.layout.fragment_chooser, container, false);
ButterKnife.bind(this, rootView);
return rootView;
}
use of android.view.LayoutInflater in project Shuttle by timusus.
the class DialogUtils method showFileInfoDialog.
public static void showFileInfoDialog(Context context, FileObject fileObject) {
if (fileObject == null) {
return;
}
View view = ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.dialog_song_info, null);
View titleView = view.findViewById(R.id.title);
TextView titleKey = (TextView) titleView.findViewById(R.id.key);
titleKey.setText(R.string.song_title);
TextView titleValue = (TextView) titleView.findViewById(R.id.value);
titleValue.setText(fileObject.tagInfo.trackName);
View trackNumberView = view.findViewById(R.id.track_number);
TextView trackNumberKey = (TextView) trackNumberView.findViewById(R.id.key);
trackNumberKey.setText(R.string.track_number);
TextView trackNumberValue = (TextView) trackNumberView.findViewById(R.id.value);
if (fileObject.tagInfo.trackTotal != 0) {
trackNumberValue.setText(String.format(context.getString(R.string.track_count), String.valueOf(fileObject.tagInfo.trackNumber), String.valueOf(fileObject.tagInfo.trackTotal)));
} else {
trackNumberValue.setText(String.valueOf(fileObject.tagInfo.trackNumber));
}
View artistView = view.findViewById(artist);
TextView artistKey = (TextView) artistView.findViewById(R.id.key);
artistKey.setText(R.string.artist_title);
TextView artistValue = (TextView) artistView.findViewById(R.id.value);
artistValue.setText(fileObject.tagInfo.artistName);
View albumView = view.findViewById(album);
TextView albumKey = (TextView) albumView.findViewById(R.id.key);
albumKey.setText(R.string.album_title);
TextView albumValue = (TextView) albumView.findViewById(R.id.value);
albumValue.setText(fileObject.tagInfo.albumName);
View genreView = view.findViewById(R.id.genre);
TextView genreKey = (TextView) genreView.findViewById(R.id.key);
genreKey.setText(R.string.genre_title);
TextView genreValue = (TextView) genreView.findViewById(R.id.value);
genreValue.setText(fileObject.tagInfo.genre);
View albumArtistView = view.findViewById(R.id.album_artist);
TextView albumArtistKey = (TextView) albumArtistView.findViewById(R.id.key);
albumArtistKey.setText(R.string.album_artist_title);
TextView albumArtistValue = (TextView) albumArtistView.findViewById(R.id.value);
albumArtistValue.setText(fileObject.tagInfo.albumArtistName);
View durationView = view.findViewById(R.id.duration);
TextView durationKey = (TextView) durationView.findViewById(R.id.key);
durationKey.setText(R.string.sort_song_duration);
TextView durationValue = (TextView) durationView.findViewById(R.id.value);
durationValue.setText(fileObject.getTimeString());
View pathView = view.findViewById(R.id.path);
TextView pathKey = (TextView) pathView.findViewById(R.id.key);
pathKey.setText(R.string.song_info_path);
TextView pathValue = (TextView) pathView.findViewById(R.id.value);
pathValue.setText(fileObject.path + "/" + fileObject.name + "." + fileObject.extension);
View discNumberView = view.findViewById(R.id.disc_number);
TextView discNumberKey = (TextView) discNumberView.findViewById(R.id.key);
discNumberKey.setText(R.string.disc_number);
TextView discNumberValue = (TextView) discNumberView.findViewById(R.id.value);
if (fileObject.tagInfo.discTotal != 0) {
discNumberValue.setText(String.format(context.getString(R.string.track_count), String.valueOf(fileObject.tagInfo.discNumber), String.valueOf(fileObject.tagInfo.discTotal)));
} else {
discNumberValue.setText(String.valueOf(fileObject.tagInfo.discNumber));
}
View fileSizeView = view.findViewById(R.id.file_size);
TextView fileSizeKey = (TextView) fileSizeView.findViewById(R.id.key);
fileSizeKey.setText(R.string.song_info_file_size);
TextView fileSizeValue = (TextView) fileSizeView.findViewById(R.id.value);
fileSizeValue.setText(FileHelper.getHumanReadableSize(fileObject.size));
View formatView = view.findViewById(R.id.format);
TextView formatKey = (TextView) formatView.findViewById(R.id.key);
formatKey.setText(R.string.song_info_format);
TextView formatValue = (TextView) formatView.findViewById(R.id.value);
formatValue.setText(fileObject.tagInfo.format);
View bitrateView = view.findViewById(R.id.bitrate);
TextView bitrateKey = (TextView) bitrateView.findViewById(R.id.key);
bitrateKey.setText(R.string.song_info_bitrate);
TextView bitrateValue = (TextView) bitrateView.findViewById(R.id.value);
bitrateValue.setText(fileObject.tagInfo.bitrate + ShuttleApplication.getInstance().getString(R.string.song_info_bitrate_suffix));
View samplingRateView = view.findViewById(R.id.sample_rate);
TextView samplingRateKey = (TextView) samplingRateView.findViewById(R.id.key);
samplingRateKey.setText(R.string.song_info_sample_Rate);
TextView samplingRateValue = (TextView) samplingRateView.findViewById(R.id.value);
samplingRateValue.setText(fileObject.tagInfo.sampleRate / 1000 + ShuttleApplication.getInstance().getString(R.string.song_info_sample_rate_suffix));
View playCountView = view.findViewById(R.id.play_count);
playCountView.setVisibility(View.GONE);
getBuilder(context).title(context.getString(R.string.dialog_song_info_title)).customView(view, false).negativeText(R.string.close).show();
}
use of android.view.LayoutInflater in project springlayout by sulewicz.
the class TestSandboxActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.test_sandbox);
mContainer = (LinearLayout) findViewById(R.id.test_layouts_container);
LayoutInflater inflater = LayoutInflater.from(this);
for (int i = 0; i < TEST_LAYOUTS.size(); ++i) {
addLayout(inflater, TEST_LAYOUTS.keyAt(i), TEST_LAYOUTS.valueAt(i));
}
for (int id : CLICKABLE_TESTS) {
setClickListener(id);
}
}
use of android.view.LayoutInflater in project glimmr by brk3.
the class GlimmrAbCustomTitle method init.
public void init(ActionBar actionbar) {
LayoutInflater inflator = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflator.inflate(R.layout.action_bar_title_item, null);
TextView abTitle = (TextView) v.findViewById(R.id.abTitle);
mTextUtils.setFont(abTitle, TextUtils.FONT_SHADOWSINTOLIGHT);
abTitle.setText(mActivity.getString(R.string.app_name));
actionbar.setDisplayShowCustomEnabled(true);
actionbar.setDisplayShowTitleEnabled(false);
actionbar.setCustomView(v);
}
use of android.view.LayoutInflater in project platform_frameworks_base by android.
the class KeyguardSecurityContainer method getSecurityView.
private KeyguardSecurityView getSecurityView(SecurityMode securityMode) {
final int securityViewIdForMode = getSecurityViewIdForMode(securityMode);
KeyguardSecurityView view = null;
final int children = mSecurityViewFlipper.getChildCount();
for (int child = 0; child < children; child++) {
if (mSecurityViewFlipper.getChildAt(child).getId() == securityViewIdForMode) {
view = ((KeyguardSecurityView) mSecurityViewFlipper.getChildAt(child));
break;
}
}
int layoutId = getLayoutIdFor(securityMode);
if (view == null && layoutId != 0) {
final LayoutInflater inflater = LayoutInflater.from(mContext);
if (DEBUG)
Log.v(TAG, "inflating id = " + layoutId);
View v = inflater.inflate(layoutId, mSecurityViewFlipper, false);
mSecurityViewFlipper.addView(v);
updateSecurityView(v);
view = (KeyguardSecurityView) v;
}
return view;
}
Aggregations