use of android.support.v7.app.AppCompatActivity in project Remindy by abicelis.
the class TextAttachmentViewHolder method handleTextEdit.
private void handleTextEdit() {
FragmentManager fm = ((AppCompatActivity) mActivity).getSupportFragmentManager();
EditTextAttachmentDialogFragment dialog = EditTextAttachmentDialogFragment.newInstance(mText.getText().toString());
dialog.setListener(this);
dialog.show(fm, "EditTextAttachmentDialogFragment");
}
use of android.support.v7.app.AppCompatActivity in project Remindy by abicelis.
the class ListItemAttachmentViewHolder method handleListItemEdit.
private void handleListItemEdit(boolean isANewItem) {
FragmentManager fm = ((AppCompatActivity) mActivity).getSupportFragmentManager();
EditListItemAttachmentDialogFragment dialog = EditListItemAttachmentDialogFragment.newInstance(isANewItem, mText.getText().toString());
dialog.setListener(this);
dialog.show(fm, "EditLinkAttachmentDialogFragment");
}
use of android.support.v7.app.AppCompatActivity in project ChatExchange by HueToYou.
the class HueUtils method setActionBarColorDefault.
public void setActionBarColorDefault(AppCompatActivity activity) {
if (mSharedPreferences == null) {
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity);
}
if (activity != null) {
ActionBar actionBar = activity.getSupportActionBar();
if (actionBar != null) {
int initialColor = mSharedPreferences.getInt("default_color", 0xFF000000);
actionBar.setBackgroundDrawable(new ColorDrawable(initialColor));
//Change status bar color too
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = activity.getWindow();
// clear FLAG_TRANSLUCENT_STATUS flag:
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// add FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag to the window
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(manipulateColor(initialColor, 0.7f));
}
}
}
}
use of android.support.v7.app.AppCompatActivity in project weex-example by KalicyZhou.
the class ScreenUtil method getSmartBarHeight.
private static int getSmartBarHeight(AppCompatActivity activity) {
ActionBar actionbar = activity.getSupportActionBar();
if (actionbar != null)
try {
Class c = Class.forName("com.android.internal.R$dimen");
Object obj = c.newInstance();
Field field = c.getField("mz_action_button_min_height");
int height = Integer.parseInt(field.get(obj).toString());
return activity.getResources().getDimensionPixelSize(height);
} catch (Exception e) {
e.printStackTrace();
actionbar.getHeight();
}
return 0;
}
use of android.support.v7.app.AppCompatActivity in project J2ME-Loader by nikita36078.
the class Form method set.
public void set(final int index, final Item item) {
items.set(index, item).setOwnerForm(null);
if (item.hasOwnerForm()) {
throw new IllegalStateException();
}
item.setOwnerForm(this);
if (layout != null) {
AppCompatActivity a = getParentActivity();
if (a != null) {
a.runOnUiThread(() -> {
layout.removeViewAt(index);
layout.addView(item.getItemView(), index);
});
}
}
}
Aggregations