use of android.annotation.SuppressLint in project photo-picker-plus-android by chute.
the class FragmentRoot method onCreateOptionsMenu.
@SuppressLint("NewApi")
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
MenuItem menuItemUse = menu.add(0, AssetActivity.USE_ITEM, 0, R.string.button_use_media);
menuItemUse.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
}
use of android.annotation.SuppressLint in project UltimateAndroid by cymcsg.
the class MaterialDesignActivity method onCreate.
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.material_design_activity_main);
buttonSelectColor = (ButtonFloatSmall) findViewById(R.id.buttonColorSelector);
buttonSelectColor.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
ColorSelector colorSelector = new ColorSelector(MaterialDesignActivity.this, backgroundColor, MaterialDesignActivity.this);
colorSelector.show();
}
});
LayoutRipple layoutRipple = (LayoutRipple) findViewById(R.id.itemButtons);
setOriginRiple(layoutRipple);
layoutRipple.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(MaterialDesignActivity.this, ButtonsActivity.class);
intent.putExtra("BACKGROUND", backgroundColor);
startActivity(intent);
}
});
layoutRipple = (LayoutRipple) findViewById(R.id.itemSwitches);
setOriginRiple(layoutRipple);
layoutRipple.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(MaterialDesignActivity.this, SwitchActivity.class);
intent.putExtra("BACKGROUND", backgroundColor);
startActivity(intent);
}
});
layoutRipple = (LayoutRipple) findViewById(R.id.itemProgress);
setOriginRiple(layoutRipple);
layoutRipple.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(MaterialDesignActivity.this, ProgressActivity.class);
intent.putExtra("BACKGROUND", backgroundColor);
startActivity(intent);
}
});
layoutRipple = (LayoutRipple) findViewById(R.id.itemWidgets);
setOriginRiple(layoutRipple);
layoutRipple.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(MaterialDesignActivity.this, WidgetActivity.class);
intent.putExtra("BACKGROUND", backgroundColor);
startActivity(intent);
}
});
}
use of android.annotation.SuppressLint in project cw-omnibus by commonsguy.
the class MainActivity method onCreate.
@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
browser = (WebView) findViewById(R.id.browser);
browser.getSettings().setJavaScriptEnabled(true);
browser.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return (true);
}
});
visit(getIntent());
}
use of android.annotation.SuppressLint in project android-betterpickers by code-troopers.
the class MonthAdapter method getView.
@SuppressLint("NewApi")
@SuppressWarnings("unchecked")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
MonthView monthView;
HashMap<String, Integer> drawingParams = null;
if (convertView != null) {
monthView = (MonthView) convertView;
// We store the drawing parameters in the view so it can be recycled
drawingParams = (HashMap<String, Integer>) monthView.getTag();
} else {
monthView = createMonthView(mContext);
monthView.setTheme(mThemeColors);
// Set up the new view
LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
monthView.setLayoutParams(params);
monthView.setClickable(true);
monthView.setOnDayClickListener(this);
}
if (drawingParams == null) {
drawingParams = new HashMap<String, Integer>();
}
drawingParams.clear();
final int month = (position + mController.getMinDate().month) % MONTHS_IN_YEAR;
final int year = (position + mController.getMinDate().month) / MONTHS_IN_YEAR + mController.getMinDate().year;
int selectedDay = -1;
if (isSelectedDayInMonth(year, month)) {
selectedDay = mSelectedDay.day;
}
int rangeMin = -1;
if (isRangeMinInMonth(year, month)) {
rangeMin = mController.getMinDate().day;
}
int rangeMax = -1;
if (isRangeMaxInMonth(year, month)) {
rangeMax = mController.getMaxDate().day;
}
// Invokes requestLayout() to ensure that the recycled view is set with the appropriate
// height/number of weeks before being displayed.
monthView.reuse();
// Set disabled days if they exist
if (mController.getDisabledDays() != null) {
monthView.setDisabledDays(mController.getDisabledDays());
}
drawingParams.put(MonthView.VIEW_PARAMS_SELECTED_DAY, selectedDay);
drawingParams.put(MonthView.VIEW_PARAMS_YEAR, year);
drawingParams.put(MonthView.VIEW_PARAMS_MONTH, month);
drawingParams.put(MonthView.VIEW_PARAMS_WEEK_START, mController.getFirstDayOfWeek());
drawingParams.put(MonthView.VIEW_PARAMS_RANGE_MIN, rangeMin);
drawingParams.put(MonthView.VIEW_PARAMS_RANGE_MAX, rangeMax);
monthView.setMonthParams(drawingParams);
monthView.invalidate();
return monthView;
}
use of android.annotation.SuppressLint in project photo-picker-plus-android by chute.
the class AssetActivity method onCreate.
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
retrieveSavedValuesFromBundle(savedInstanceState);
wrapper = new PhotosIntentWrapper(getIntent());
account = wrapper.getAccount();
filterType = wrapper.getFilterType();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
if (savedInstanceState == null) {
fragmentRoot = FragmentRoot.newInstance(account, filterType, selectedAccountsPositions, selectedImagesPositions, selectedVideosPositions);
ft.add(R.id.gcFragments, fragmentRoot, FragmentUtil.TAG_FRAGMENT_FOLDER).commit();
}
}
Aggregations