use of android.widget.TextView in project MaterializeYourApp by antoniolg.
the class DetailActivity method onCreate.
@SuppressWarnings("ConstantConditions")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initActivityTransitions();
setContentView(R.layout.activity_detail);
ViewCompat.setTransitionName(findViewById(R.id.app_bar_layout), EXTRA_IMAGE);
supportPostponeEnterTransition();
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
String itemTitle = getIntent().getStringExtra(EXTRA_TITLE);
collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsingToolbarLayout.setTitle(itemTitle);
collapsingToolbarLayout.setExpandedTitleColor(getResources().getColor(android.R.color.transparent));
final ImageView image = (ImageView) findViewById(R.id.image);
Picasso.with(this).load(getIntent().getStringExtra(EXTRA_IMAGE)).into(image, new Callback() {
@Override
public void onSuccess() {
Bitmap bitmap = ((BitmapDrawable) image.getDrawable()).getBitmap();
Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {
public void onGenerated(Palette palette) {
applyPalette(palette);
}
});
}
@Override
public void onError() {
}
});
TextView title = (TextView) findViewById(R.id.title);
title.setText(itemTitle);
}
use of android.widget.TextView in project IceNet by anton46.
the class JsonObjectActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_json_object);
final TextView id = (TextView) findViewById(R.id.tv_id);
final TextView title = (TextView) findViewById(R.id.tv_title);
final ProgressDialog dialog = new ProgressDialog(this);
dialog.setMessage("Loading...");
dialog.show();
IceNet.connect().createRequest().get().pathUrl("/notes/1").fromJsonObject().mappingInto(Note.class).execute("request_string", new RequestCallback<Note>() {
@Override
public void onRequestSuccess(Note note) {
dialog.dismiss();
id.setText(note.getId());
title.setText(note.getTitle());
}
@Override
public void onRequestError(RequestError error) {
dialog.dismiss();
}
});
}
use of android.widget.TextView in project IceNet by anton46.
the class StringActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_string);
final TextView result = (TextView) findViewById(R.id.tv_result);
final ProgressDialog dialog = new ProgressDialog(this);
dialog.setMessage("Loading...");
dialog.show();
IceNet.connect().createRequest().get().pathUrl("/string").fromString().execute("request_string", new RequestCallback<String>() {
@Override
public void onRequestSuccess(String str) {
dialog.dismiss();
result.setText(str);
}
@Override
public void onRequestError(RequestError error) {
dialog.dismiss();
}
});
}
use of android.widget.TextView in project android by cSploit.
the class Inspector method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
SharedPreferences themePrefs = getSharedPreferences("THEME", 0);
Boolean isDark = themePrefs.getBoolean("isDark", false);
if (isDark)
setTheme(R.style.DarkTheme);
else
setTheme(R.style.AppTheme);
super.onCreate(savedInstanceState);
mStartButton = (FloatingActionButton) findViewById(R.id.inspectToggleButton);
mActivity = (ProgressBar) findViewById(R.id.inspectActivity);
TextView mDeviceName = (TextView) findViewById(R.id.deviceName);
mDeviceType = (TextView) findViewById(R.id.deviceType);
mDeviceOS = (TextView) findViewById(R.id.deviceOS);
mDeviceServices = (TextView) findViewById(R.id.deviceServices);
mFocusedScan = System.getCurrentTarget().hasOpenPorts();
mDeviceName.setText(System.getCurrentTarget().toString());
if (System.getCurrentTarget().getDeviceType() != null)
mDeviceType.setText(System.getCurrentTarget().getDeviceType());
if (System.getCurrentTarget().getDeviceOS() != null)
mDeviceOS.setText(System.getCurrentTarget().getDeviceOS());
empty = getText(R.string.unknown).toString();
// yep, we're on main thread here
write_services();
mStartButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mRunning) {
setStoppedState();
} else {
setStartedState();
}
}
});
mReceiver = new Receiver(System.getCurrentTarget());
}
use of android.widget.TextView in project Launcher3 by chislon.
the class LiveWallpaperListAdapter method getView.
public View getView(int position, View convertView, ViewGroup parent) {
View view;
if (convertView == null) {
view = mInflater.inflate(R.layout.wallpaper_picker_live_wallpaper_item, parent, false);
} else {
view = convertView;
}
WallpaperPickerActivity.setWallpaperItemPaddingToZero((FrameLayout) view);
LiveWallpaperTile wallpaperInfo = mWallpapers.get(position);
wallpaperInfo.setView(view);
ImageView image = (ImageView) view.findViewById(R.id.wallpaper_image);
ImageView icon = (ImageView) view.findViewById(R.id.wallpaper_icon);
if (wallpaperInfo.mThumbnail != null) {
image.setImageDrawable(wallpaperInfo.mThumbnail);
icon.setVisibility(View.GONE);
} else {
icon.setImageDrawable(wallpaperInfo.mInfo.loadIcon(mPackageManager));
icon.setVisibility(View.VISIBLE);
}
TextView label = (TextView) view.findViewById(R.id.wallpaper_item_label);
label.setText(wallpaperInfo.mInfo.loadLabel(mPackageManager));
return view;
}
Aggregations