Search in sources :

Example 6 with SuppressLint

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);
}
Also used : MenuItem(android.view.MenuItem) SuppressLint(android.annotation.SuppressLint)

Example 7 with SuppressLint

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);
        }
    });
}
Also used : LayoutRipple(com.gc.materialdesign.views.LayoutRipple) OnClickListener(android.view.View.OnClickListener) Intent(android.content.Intent) ColorSelector(com.gc.materialdesign.widgets.ColorSelector) View(android.view.View) SuppressLint(android.annotation.SuppressLint)

Example 8 with SuppressLint

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());
}
Also used : WebView(android.webkit.WebView) WebViewClient(android.webkit.WebViewClient) SuppressLint(android.annotation.SuppressLint)

Example 9 with SuppressLint

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;
}
Also used : LayoutParams(android.widget.AbsListView.LayoutParams) SuppressLint(android.annotation.SuppressLint) SuppressLint(android.annotation.SuppressLint)

Example 10 with SuppressLint

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();
    }
}
Also used : PhotosIntentWrapper(com.getchute.android.photopickerplus.util.intent.PhotosIntentWrapper) FragmentTransaction(android.support.v4.app.FragmentTransaction) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)671 View (android.view.View)141 TextView (android.widget.TextView)89 Intent (android.content.Intent)71 Paint (android.graphics.Paint)61 ImageView (android.widget.ImageView)42 WebView (android.webkit.WebView)33 Bitmap (android.graphics.Bitmap)30 ListView (android.widget.ListView)30 File (java.io.File)28 ViewGroup (android.view.ViewGroup)26 AdapterView (android.widget.AdapterView)25 AlertDialog (android.app.AlertDialog)23 DialogInterface (android.content.DialogInterface)22 TypedArray (android.content.res.TypedArray)22 Uri (android.net.Uri)22 OnClickListener (android.view.View.OnClickListener)22 LayoutInflater (android.view.LayoutInflater)21 Point (android.graphics.Point)20 ArrayList (java.util.ArrayList)20