use of com.mikepenz.lollipopshowcase.entity.AppInfo in project LollipopShowcase by mikepenz.
the class DetailActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
mCoordinatorLayout = (CoordinatorLayout) findViewById(R.id.container);
mRowContainer = (LinearLayout) findViewById(R.id.row_container);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Handle Back Navigation :D
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DetailActivity.this.onBackPressed();
}
});
// Fab Button
FloatingActionButton floatingActionButton = (FloatingActionButton) findViewById(R.id.fab_normal);
floatingActionButton.setImageDrawable(new IconicsDrawable(this, GoogleMaterial.Icon.gmd_file_upload).color(Color.WHITE).actionBar());
floatingActionButton.setOnClickListener(fabClickListener);
for (int i = 1; i < mRowContainer.getChildCount(); i++) {
View rowView = mRowContainer.getChildAt(i);
rowView.animate().setStartDelay(100 + i * SCALE_DELAY).scaleX(1).scaleY(1);
}
ComponentName componentName = null;
if (savedInstanceState != null) {
componentName = savedInstanceState.getParcelable("appInfo");
} else if (getIntent() != null && getIntent().getExtras() != null) {
componentName = (ComponentName) getIntent().getExtras().get("appInfo");
}
if (componentName != null) {
Intent intent = new Intent();
intent.setComponent(componentName);
ResolveInfo app = getPackageManager().resolveActivity(intent, 0);
mAppInfo = new AppInfo(this, app);
}
if (mAppInfo != null) {
//toolbar.setLogo(mAppInfo.getIcon());
toolbar.setTitle(mAppInfo.getName());
View view = mRowContainer.findViewById(R.id.row_name);
fillRow(view, "Application Name", mAppInfo.getName());
((ImageView) view.findViewById(R.id.appIcon)).setImageDrawable(mAppInfo.getIcon());
view = mRowContainer.findViewById(R.id.row_package_name);
fillRow(view, "Package Name", mAppInfo.getPackageName());
view = mRowContainer.findViewById(R.id.row_activity);
fillRow(view, "Activity", mAppInfo.getActivityName());
view = mRowContainer.findViewById(R.id.row_component_info);
fillRow(view, "ComponentInfo", mAppInfo.getComponentInfo());
view = mRowContainer.findViewById(R.id.row_version);
fillRow(view, "Version", mAppInfo.getVersionName() + " (" + mAppInfo.getVersionCode() + ")");
view = mRowContainer.findViewById(R.id.row_moments);
fillRow(view, "Moments", "First installed: " + new Date(mAppInfo.getFirstInstallTime()) + "\nLast updated: " + new Date(mAppInfo.getLastUpdateTime()));
}
}
use of com.mikepenz.lollipopshowcase.entity.AppInfo in project LollipopShowcase by mikepenz.
the class ApplicationAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(final ViewHolder viewHolder, int i) {
final AppInfo appInfo = applications.get(i);
viewHolder.name.setText(appInfo.getName());
viewHolder.image.setImageDrawable(appInfo.getIcon());
viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mAct.animateActivity(appInfo, viewHolder.image);
}
});
}
Aggregations