Example usage for android.content.res Configuration SCREENLAYOUT_SIZE_LARGE

List of usage examples for android.content.res Configuration SCREENLAYOUT_SIZE_LARGE

Introduction

In this page you can find the example usage for android.content.res Configuration SCREENLAYOUT_SIZE_LARGE.

Prototype

int SCREENLAYOUT_SIZE_LARGE

To view the source code for android.content.res Configuration SCREENLAYOUT_SIZE_LARGE.

Click Source Link

Document

Constant for #screenLayout : a #SCREENLAYOUT_SIZE_MASK value indicating the screen is at least approximately 480x640 dp units, corresponds to the large resource qualifier.

Usage

From source file:com.mruddy.devdataviewer.DevDataListFragment.java

@SuppressLint("InlinedApi")
private static void initMaps() {
    DevDataListFragment.DENSITY_BUCKETS.append(DisplayMetrics.DENSITY_LOW, "LDPI");
    DevDataListFragment.DENSITY_BUCKETS.append(DisplayMetrics.DENSITY_MEDIUM, "MDPI");
    DevDataListFragment.DENSITY_BUCKETS.append(DisplayMetrics.DENSITY_HIGH, "HDPI");
    DevDataListFragment.DENSITY_BUCKETS.append(DisplayMetrics.DENSITY_XHIGH, "XHDPI");
    DevDataListFragment.DENSITY_BUCKETS.append(DisplayMetrics.DENSITY_XXHIGH, "XXHDPI");
    DevDataListFragment.DENSITY_BUCKETS.append(DisplayMetrics.DENSITY_XXXHIGH, "XXXHDPI");
    DevDataListFragment.ROTATION.append(Surface.ROTATION_0, "0");
    DevDataListFragment.ROTATION.append(Surface.ROTATION_90, "90");
    DevDataListFragment.ROTATION.append(Surface.ROTATION_180, "180");
    DevDataListFragment.ROTATION.append(Surface.ROTATION_270, "270");
    DevDataListFragment.ORIENTATION.append(Configuration.ORIENTATION_UNDEFINED, "undefined");
    DevDataListFragment.ORIENTATION.append(Configuration.ORIENTATION_PORTRAIT, "portrait");
    DevDataListFragment.ORIENTATION.append(Configuration.ORIENTATION_LANDSCAPE, "landscape");
    DevDataListFragment.SCREEN_SIZE_BUCKETS.append(Configuration.SCREENLAYOUT_SIZE_UNDEFINED, "undefined");
    DevDataListFragment.SCREEN_SIZE_BUCKETS.append(Configuration.SCREENLAYOUT_SIZE_SMALL, "small");
    DevDataListFragment.SCREEN_SIZE_BUCKETS.append(Configuration.SCREENLAYOUT_SIZE_NORMAL, "normal");
    DevDataListFragment.SCREEN_SIZE_BUCKETS.append(Configuration.SCREENLAYOUT_SIZE_LARGE, "large");
    DevDataListFragment.SCREEN_SIZE_BUCKETS.append(Configuration.SCREENLAYOUT_SIZE_XLARGE, "xlarge");
}

From source file:com.adjust.sdk.Util.java

private static String getDeviceType(final int screenLayout) {
    int screenSize = screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;

    switch (screenSize) {
    case Configuration.SCREENLAYOUT_SIZE_SMALL:
    case Configuration.SCREENLAYOUT_SIZE_NORMAL:
        return "phone";
    case Configuration.SCREENLAYOUT_SIZE_LARGE:
    case 4:/*from w w  w.j a  va  2  s . co  m*/
        return "tablet";
    default:
        return UNKNOWN;
    }
}

From source file:com.health.openscale.gui.TableFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    tableView = inflater.inflate(R.layout.fragment_table, container, false);

    tableDataView = (TableLayout) tableView.findViewById(R.id.tableDataView);

    tableView.findViewById(R.id.btnImportData).setOnClickListener(new onClickListenerImport());

    tableView.findViewById(R.id.btnExportData).setOnClickListener(new onClickListenerExport());

    tableView.findViewById(R.id.btnDeleteAll).setOnClickListener(new onClickListenerDeleteAll());

    if ((getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_XLARGE
            && (getResources().getConfiguration().screenLayout
                    & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_LARGE) {
        TextView txtDateTableHeader = (TextView) tableView.findViewById(R.id.txtDateTableHeader);
        txtDateTableHeader.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 11);
        TextView txtTimeTableHeader = (TextView) tableView.findViewById(R.id.txtTimeTableHeader);
        txtTimeTableHeader.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 11);
        TextView txtWeightTableHeader = (TextView) tableView.findViewById(R.id.txtWeightTableHeader);
        txtWeightTableHeader.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 11);
        TextView txtFatTableHeader = (TextView) tableView.findViewById(R.id.txtFatTableHeader);
        txtFatTableHeader.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 11);
        TextView txtWaterTableHeader = (TextView) tableView.findViewById(R.id.txtWaterTableHeader);
        txtWaterTableHeader.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 11);
        TextView txtMuscleTableHeader = (TextView) tableView.findViewById(R.id.txtMuscleTableHeader);
        txtMuscleTableHeader.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 11);
        Button btnDeleteAll = (Button) tableView.findViewById(R.id.btnDeleteAll);
        btnDeleteAll.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 11);
    }/*www . ja v  a 2  s .  c o  m*/

    return tableView;
}

From source file:com.brayanarias.alarmproject.fragment.AlarmListFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View layout = inflater.inflate(R.layout.fragment_alarm_list, container, false);
    RecyclerView recyclerView = (RecyclerView) layout.findViewById(R.id.alarmList);
    AlarmListAdapter alarmListAdapter = new AlarmListAdapter(getData(), (MainActivity) getActivity());
    recyclerView.setAdapter(alarmListAdapter);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
    linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    linearLayoutManager.scrollToPosition(0);
    recyclerView.setLayoutManager(linearLayoutManager);
    if ((getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE) {
        GridLayoutManager gridLayoutManager;
        if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
            gridLayoutManager = new GridLayoutManager(getActivity().getBaseContext(), 3);
            recyclerView.setLayoutManager(gridLayoutManager);
        } else {//  ww w. ja v a  2  s.  c  o m
            gridLayoutManager = new GridLayoutManager(getActivity().getBaseContext(), 2);
            recyclerView.setLayoutManager(gridLayoutManager);
        }
        recyclerView.setLayoutManager(gridLayoutManager);
    }
    FloatingActionButton fab = (FloatingActionButton) layout.findViewById(R.id.fab);
    fab.setOnClickListener(this);
    return layout;
}

From source file:org.flexlabs.widgets.dualbattery.widgetsettings.WidgetActivity.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    startService(new Intent(this, MonitorService.class));
    Bundle extras = getIntent().getExtras();
    appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);

    fragments = new Fragment[5];
    fragments[0] = new BatteryInfoFragment();
    fragments[1] = new PropertiesFragment();
    fragments[2] = new FeedbackFragment();
    fragments[3] = new DonateFragment();
    fragments[4] = new AboutFragment();
    titles = new String[5];
    titles[0] = getString(R.string.propHeader_BatteryInfo);
    titles[1] = getString(R.string.propHeader_Properties);
    titles[2] = getString(R.string.propHeader_Feedback);
    titles[3] = getString(R.string.propHeader_Donate);
    titles[4] = getString(R.string.propHeader_About);

    int screenLayout = getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB
            && screenLayout > Configuration.SCREENLAYOUT_SIZE_LARGE) {
        setContentView(R.layout.preference_list_large);

        ArrayAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_activated_1,
                titles);/* ww  w .j  a v a  2 s .c  o  m*/

        mList = (ListView) findViewById(android.R.id.list);
        mList.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
        mList.setOnItemClickListener(this);
        mList.setAdapter(adapter);
        mList.setItemChecked(0, true);
        mList.performClick();
        getSupportFragmentManager().beginTransaction().replace(R.id.prefs, fragments[0]).commit();
    } else {
        setContentView(R.layout.widgetsettings);
        PagerTabAdapter mPagerAdapter = new PagerTabAdapter(getSupportFragmentManager());
        ViewPager mPager = (ViewPager) findViewById(R.id.pager);
        mPager.setAdapter(mPagerAdapter);

        PageIndicator mIndicator = (TabPageIndicator) findViewById(R.id.indicator);
        mIndicator.setViewPager(mPager);
    }

    if (WidgetSettingsContainer.getUpgradeSwappedSingle(this, appWidgetId)) {
        new AlertDialog.Builder(this).setTitle(R.string.app_name).setMessage(R.string.alert_just_swapped)
                .setPositiveButton("OK", null).show();
    }
}

From source file:whipkey.stemesteem.components.EndingListFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    if ((getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) < Configuration.SCREENLAYOUT_SIZE_LARGE) { // checks for large/xlarge screen.
        fillData();/* w w  w  .  j a v  a  2  s  .c o m*/
    } // if we are on a large/xlarge screen device, skip the above and wait
      // for StemEsteem to call for fillData().
    addEndingButton = (Button) getView().findViewById(R.id.addEndingButton);
    addEndingButton.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            if (b != null) { // make sure a bundle existant.
                dialogClickListener.dialogItemClick(b, 1); // our add ending
                // button was
            } // clicked, ask for
              // a
              // AddEndingDialog.
        }
    });

}

From source file:org.peercast.pecaport.PecaPortFragmentBase.java

@Nullable
@Override//from w ww.  ja va  2 s .com
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    //Disable???????????FrameLayout
    ContainerFrame exFrame = new ContainerFrame(container.getContext());
    exFrame.addView(inflater.inflate(R.layout.pecaport, null));

    boolean isTablet = getContext().getResources().getConfiguration()
            .isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE);

    //Gone: ?????
    exFrame.findViewById(R.id.vLayoutPadding1).setVisibility(isTablet ? View.GONE : View.VISIBLE);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        //6.0Wifi?MacAddress?"02:00:00:00:00:00:00"??????
        exFrame.findViewById(R.id.vRowHardwareAddress).setVisibility(View.GONE);
    }
    return exFrame;
}

From source file:com.near.chimerarevo.fragments.ProductsListFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.products_grid_layout, container, false);

    boolean isLandscapeLarge = false;

    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
        if ((getResources().getConfiguration().screenLayout
                & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE)
            isLandscapeLarge = true;//  w  w  w  .j av a2  s  .com
    } else
        isLandscapeLarge = false;

    if (!isLandscapeLarge)
        v.setPadding(0, getResources().getDimensionPixelSize(R.dimen.actionbar_height), 0, 0);

    GridView mGrid = (GridView) v.findViewById(R.id.products_grid);
    mCat = (Spinner) v.findViewById(R.id.category_spinner);
    mBrand = (Spinner) v.findViewById(R.id.brand_spinner);
    mLoading = (ProgressWheel) v.findViewById(R.id.product_progress);

    brandsList = new ArrayList<>();
    catList = new ArrayList<>();
    catIdList = new ArrayList<>();

    arrayList = new ArrayList<>();

    mAdapter = new ProductsAdapter(arrayList);
    if (mGrid != null) {
        mGrid.setAdapter(mAdapter);
        mGrid.setOnScrollListener(this);
        mGrid.setOnItemClickListener(this);
    }

    return v;
}

From source file:com.coinblesk.client.KeyboardFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_keyboard, container, false);

    final int screenLayout = getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK;
    switch (screenLayout) {
    case Configuration.SCREENLAYOUT_SIZE_LARGE:
    case Configuration.SCREENLAYOUT_SIZE_XLARGE:
        initLarge(view);/*  ww  w . java 2  s .  co  m*/
        break;
    default:
        initStandard(view);
        break;
    }

    TextView t1 = (TextView) view.findViewById(R.id.amount_large_text_view);
    TextView t2 = (TextView) view.findViewById(R.id.amount_large_text_currency);
    TextView t3 = (TextView) view.findViewById(R.id.amount_small_text_view);
    TextView t4 = (TextView) view.findViewById(R.id.amount_small_text_currency);

    View.OnLongClickListener listener = new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            DialogFragment fragment = CurrencyDialogFragment.newInstance();
            if (fragment != null) {
                fragment.show(KeyboardFragment.this.getFragmentManager(), TAG);
            }
            return true;
        }
    };

    t1.setOnLongClickListener(listener);
    t2.setOnLongClickListener(listener);
    t3.setOnLongClickListener(listener);
    t4.setOnLongClickListener(listener);

    UIUtils.refreshConnectionIconStatus(getActivity(), view);

    return view;
}

From source file:com.near.chimerarevo.activities.PostContainerActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
        if ((getResources().getConfiguration().screenLayout
                & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE)
            isLandscapeLarge = true;//from w  ww  . ja va  2s.  c om
    } else
        isLandscapeLarge = false;

    getToolbar().setNavigationIcon(getResources().getDrawable(R.drawable.ic_action_arrow_back));
    getToolbar().setNavigationOnClickListener(this);

    if (!isLandscapeLarge) {
        pager = (ViewPager) findViewById(R.id.view_pager);
        pager.setOnPageChangeListener(this);
    }
    mLoading = (ProgressWheel) findViewById(R.id.post_progress);
    mShadow = findViewById(R.id.drop_shadow);

    args = getIntent().getExtras();

    if (savedInstanceState != null)
        args = savedInstanceState.getBundle("arguments");

    if (args.containsKey(Constants.KEY_DATE))
        setToolbarStatusColor(args.getString(Constants.KEY_DATE).split("[\\x7C]")[1].trim());

    if (getIntent().getData() != null) {
        List<String> params = getIntent().getData().getPathSegments();
        if (params != null && params.size() > 0) {
            String ext_url = Constants.SITE_URL;
            for (String p : params) {
                ext_url += p + "/";
            }

            if (ext_url.contains("/" + Constants.PRODOTTI + "/")) {
                Intent i = new Intent(Intent.ACTION_VIEW);
                i.setData(Uri.parse(ext_url));
                startActivity(i);
                finish();
            } else {
                if (ext_url.contains("/" + Constants.RECENSIONI + "/"))
                    args.putString(Constants.KEY_TYPE, Constants.RECENSIONI);
                else if (ext_url.contains("/" + Constants.VIDEO + "/"))
                    args.putString(Constants.KEY_TYPE, Constants.VIDEO);

                OkHttpUtils.getInstance().newCall(
                        new Request.Builder().url(URLUtils.getPostUrl(ext_url)).tag(ACTIVITY_TAG).build())
                        .enqueue(new GetPostCallback());
            }
        }
    }

    if (args != null) {
        if (!args.containsKey("isLandscapeLarge"))
            args.putBoolean("isLandscapeLarge", isLandscapeLarge);

        if (args.containsKey(Constants.KEY_ID)) {
            int post_id = args.getInt(Constants.KEY_ID);
            OkHttpUtils.getInstance()
                    .newCall(new Request.Builder().url(URLUtils.getPostUrl(post_id)).tag(ACTIVITY_TAG).build())
                    .enqueue(new GetPostCallback());
        } else if (args.containsKey(Constants.KEY_URL)) {
            String post_url = args.getString(Constants.KEY_URL);
            OkHttpUtils.getInstance()
                    .newCall(new Request.Builder().url(URLUtils.getPostUrl(post_url)).tag(ACTIVITY_TAG).build())
                    .enqueue(new GetPostCallback());
        }
    }
}