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:net.olejon.spotcommander.MyTools.java

public boolean allowLandscape() {
    final int size = mContext.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK;

    return ((size) == Configuration.SCREENLAYOUT_SIZE_LARGE
            || (size) == Configuration.SCREENLAYOUT_SIZE_XLARGE);
}

From source file:net.movelab.cmlibrary.MapMyData.java

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    final int screenSize = getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK;
    if (screenSize != Configuration.SCREENLAYOUT_SIZE_LARGE
            && screenSize != Configuration.SCREENLAYOUT_SIZE_XLARGE)
        requestWindowFeature(Window.FEATURE_NO_TITLE);

    // TODO add all of the alerts from countdown activity regarding sensors
    // off, sm off etc.

    Context context = getApplicationContext();
    PropertyHolder.init(context);/*from  w  ww  .  j av  a  2  s.c o  m*/
    PowerSensor.init(context);

    if (Util.trafficCop(this))
        finish();

    if (!PropertyHolder.getInitialStartDateSet()) {
        Calendar now = Calendar.getInstance();
        now.setTimeInMillis(System.currentTimeMillis());
        PropertyHolder.setMapStartDate(now);
        PropertyHolder.setInitialStartDateSet(true);
    }

    minDist = Util.getMinDist();
    // Log.e("FixGet", "minDist=" + minDist);

    setContentView(R.layout.map_layout);
    mapView = (MapView) findViewById(R.id.mapview);
    mapView.setBuiltInZoomControls(true);

    // pauseToggle = !PropertyHolder.isServiceOn();

    mPoints = new ArrayList<MapPoint>();

    myMapController = mapView.getController();
    myMapController.setZoom(15);

    progressbar = (ProgressBar) findViewById(R.id.mapProgressbar);
    progressbar.setProgress(0);

    progressbarText = (TextView) findViewById(R.id.progressBarLabel);

    progressNotificationArea = (LinearLayout) findViewById(R.id.mapProgressNotificationArea);

    receiverNotificationArea = (LinearLayout) findViewById(R.id.mapReceiverNotificationArea);

    mReceiversOffWarning = (TextView) findViewById(R.id.mapReceiversOffWarning);

    dateArea = (RelativeLayout) findViewById(R.id.dateArea);

    dateRangeText = (TextView) findViewById(R.id.dateSelectionText);

    dateRangeText.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent e) {

            if (e.getAction() == MotionEvent.ACTION_DOWN) {

                dateRangeText.setBackgroundResource(R.drawable.red_border_pressed);
            }
            if (e.getAction() == MotionEvent.ACTION_UP) {

                dateRangeText.setBackgroundResource(R.drawable.red_border);
            }

            return false;
        }

    });

    dateRangeText.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {

            Intent i = new Intent(MapMyData.this, Settings.class);
            i.putExtra(DATES_BUTTON_MESSAGE, true);
            startActivity(i);

        }

    });

    getIntro = PropertyHolder.getIntro();
    isPro = PropertyHolder.getProVersion();

    AppRater.app_launched(this);

    privacyZones = new ArrayList<GeoPoint>();

}

From source file:com.bydavy.card.receipts.activities.ReceiptListActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_receipt_list);
    mLoadingView = findViewById(R.id.loading_container);
    mContentView = findViewById(R.id.content_container);
    setupActionBar();/*from www .jav a 2 s. c  om*/

    final View detailFrame = findViewById(FRAGMENT_PAGER_FRAGMENT_ID);
    mDualPane = (detailFrame != null) && (detailFrame.getVisibility() == View.VISIBLE);

    if (savedInstanceState != null) {
        mReceiptListFragment = (ReceiptListFragment) getSupportFragmentManager()
                .findFragmentById(FRAGMENT_RECEIPT_LIST_ID);
        if (mDualPane) {
            mPagerFragment = (ReceiptPagerFragment) getSupportFragmentManager()
                    .findFragmentById(FRAGMENT_PAGER_FRAGMENT_ID);
        }

        final int navListIndex = savedInstanceState.getInt(SAVED_STATE_NAVIGATION_LIST_INDEX);
        // We are going to recreate fragments accordingly to navListIndex
        // saved (Easier to handle that reusing)
        getSupportActionBar().setSelectedNavigationItem(navListIndex);

        if ((getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE)
                && AndroidUtils.isScreenSizeBiggerOrEqual(getResources(),
                        Configuration.SCREENLAYOUT_SIZE_LARGE)) {
            final int index = savedInstanceState.getInt(SAVED_STATE_LIST_INDEX);

            // In this case we need open the receipt pager
            startActivityReceiptPager(index, mReceiptListFragment.getCursorSelection(),
                    mReceiptListFragment.getCursorSelectionArgs(), mReceiptListFragment.getCursorSortOrder());
        }
    }

    // sampleData();
}

From source file:whipkey.stemesteem.main.StemEsteem.java

public void stemListItemClick(int weekNo, int stemNo, String stem) {
    if ((getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE) {
        EndingListFragment f = (EndingListFragment) getSupportFragmentManager().findFragmentByTag("endingList");
        Bundle b = new Bundle();
        b.putInt("weekNo", weekNo);
        b.putInt("stemNo", stemNo);
        b.putString("stem", stem);
        f.setB(b);//  ww  w. j a v  a 2 s .  c om
        f.fillData();

    } else {
        Intent showEndings = new Intent(getApplicationContext(), EndingListActivity.class);
        showEndings.putExtra("weekNo", weekNo);
        showEndings.putExtra("stemNo", stemNo);
        showEndings.putExtra("stem", stem);
        startActivity(showEndings);
    }
}

From source file:net.olejon.mdapp.MyTools.java

public boolean isTablet() {
    int size = mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;

    return ((size) == Configuration.SCREENLAYOUT_SIZE_LARGE
            || (size) == Configuration.SCREENLAYOUT_SIZE_XLARGE);
}

From source file:piuk.blockchain.android.ui.WalletActivity.java

@Override
protected void onCreate(final Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    ErrorReporter.getInstance().check(this);

    setContentView(R.layout.wallet_content);

    final ActionBarFragment actionBar = getActionBar();

    actionBar.setPrimaryTitle(R.string.app_name);

    actionBar.getPrimaryTitleView().setOnClickListener(new OnClickListener() {
        public void onClick(final View v) {
            WelcomeFragment.show(getSupportFragmentManager());
        }//from   w ww. j a  va2  s . c  o m
    });

    actionBar.addButton(R.drawable.ic_action_send).setOnClickListener(new OnClickListener() {
        public void onClick(final View v) {
            startActivity(new Intent(WalletActivity.this, SendCoinsActivity.class));
        }
    });

    actionBar.addButton(R.drawable.ic_action_receive).setOnClickListener(new OnClickListener() {
        public void onClick(final View v) {
            startActivity(new Intent(WalletActivity.this, RequestCoinsActivity.class));
        }
    });

    infoButton = actionBar.addButton(R.drawable.ic_action_info);

    infoButton.setOnClickListener(new OnClickListener() {
        public void onClick(final View v) {
            WalletApplication application = (WalletApplication) getApplication();

            Intent browserIntent = new Intent(Intent.ACTION_VIEW,
                    Uri.parse("https://blockchain.info/wallet/iphone-view?guid="
                            + application.getRemoteWallet().getGUID() + "&sharedKey="
                            + application.getRemoteWallet().getSharedKey()));

            startActivity(browserIntent);
        }
    });

    if ((getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE) {
        actionBar.addButton(R.drawable.ic_action_address_book).setOnClickListener(new OnClickListener() {
            public void onClick(final View v) {
                WalletAddressesActivity.start(WalletActivity.this, true);
            }
        });
    }

    if ((getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) < Configuration.SCREENLAYOUT_SIZE_LARGE) {
        final FragmentManager fm = getSupportFragmentManager();
        final FragmentTransaction ft = fm.beginTransaction();
        ft.hide(fm.findFragmentById(R.id.exchange_rates_fragment));
        ft.commit();
    }

    checkVersionAndTimeskewAlert();

    checkDialogs();
}

From source file:com.raja.knowme.FragmentProjects.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View mHolderView = inflater.inflate(R.layout.fragment_projects, null);
    shake = AnimationUtils.loadAnimation(getActivity(), R.anim.shake);
    adapter = new ProjectsListAdapter(getActivity());
    functions = new AppCommonFunctions(getActivity());
    pref = new AppPreferences(getActivity());
    knowmeData = new KnowMeDataObject(getActivity());
    mProgressDialog = new ProgressDialog(getActivity());
    mProgressDialog.setCancelable(false);
    mProgressDialog.setMessage(getString(R.string.loading));

    projects_list = (ListView) mHolderView.findViewById(R.id.projects_listview);
    comapny_switcher = (TextSwitcher) mHolderView.findViewById(R.id.projects_company_name_text);
    instruction_btn = (RelativeLayout) mHolderView.findViewById(R.id.instrunstions_layout);

    projects_list.setSelector(this.getResources().getDrawable(R.drawable.transparent_shape));

    if (!pref.getProjectsFirstRun()) {
        instruction_btn.setVisibility(RelativeLayout.GONE);
    }//  ww  w.j a  v  a  2  s .  com

    instruction_btn.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            pref.setProjectsRunned();
            instruction_btn.setVisibility(RelativeLayout.GONE);
        }
    });
    /*                 Multiple Screen Size Condition             */

    // Small Size

    if ((getContext().getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_SMALL) {
        //  Toast.makeText(getActivity(), "small", Toast.LENGTH_SHORT).show();
        comapny_switcher.setFactory(new ViewSwitcher.ViewFactory() {
            public View makeView() {
                /** Set up the custom auto scrolling text view class for lengthy album names */
                AppTextView textSwitcher_text = new AppTextView(getActivity());
                textSwitcher_text.setTextColor(Color.argb(225, 245, 242, 11));
                textSwitcher_text.setTextSize(16 * functions.getScreenDPI());
                textSwitcher_text.setSingleLine(true);
                textSwitcher_text.setEllipsize(TextUtils.TruncateAt.MARQUEE);
                textSwitcher_text.setMarqueeRepeatLimit(-1);
                textSwitcher_text.setHorizontallyScrolling(true);
                return textSwitcher_text;
            }
        });
    }

    //Normal Size

    else if ((getContext().getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL) {
        // Toast.makeText(getActivity(), "normal", Toast.LENGTH_SHORT).show();
        comapny_switcher.setFactory(new ViewSwitcher.ViewFactory() {
            public View makeView() {
                /** Set up the custom auto scrolling text view class for lengthy album names */
                AppTextView textSwitcher_text = new AppTextView(getActivity());
                textSwitcher_text.setTextColor(Color.argb(225, 245, 242, 11));
                textSwitcher_text.setTextSize(14 * functions.getScreenDPI());
                textSwitcher_text.setSingleLine(true);
                textSwitcher_text.setEllipsize(TextUtils.TruncateAt.MARQUEE);
                textSwitcher_text.setMarqueeRepeatLimit(-1);
                textSwitcher_text.setHorizontallyScrolling(true);
                return textSwitcher_text;
            }
        });

    }

    // Large Size

    else if ((getContext().getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE) {
        // Toast.makeText(getActivity(), "large", Toast.LENGTH_SHORT).show();
        comapny_switcher.setFactory(new ViewSwitcher.ViewFactory() {
            public View makeView() {
                /** Set up the custom auto scrolling text view class for lengthy album names */
                AppTextView textSwitcher_text = new AppTextView(getActivity());
                textSwitcher_text.setTextColor(Color.argb(225, 245, 242, 11));
                textSwitcher_text.setTextSize(32 * functions.getScreenDPI());
                textSwitcher_text.setSingleLine(true);
                textSwitcher_text.setEllipsize(TextUtils.TruncateAt.MARQUEE);
                textSwitcher_text.setMarqueeRepeatLimit(-1);
                textSwitcher_text.setHorizontallyScrolling(true);
                return textSwitcher_text;
            }
        });

    }

    //X-large Size

    else if ((getContext().getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE) {
        //  Toast.makeText(getActivity(), "xlarge", Toast.LENGTH_SHORT).show();
        comapny_switcher.setFactory(new ViewSwitcher.ViewFactory() {
            public View makeView() {
                /** Set up the custom auto scrolling text view class for lengthy album names */
                AppTextView textSwitcher_text = new AppTextView(getActivity());
                textSwitcher_text.setTextColor(Color.argb(225, 245, 242, 11));
                textSwitcher_text.setTextSize(48 * functions.getScreenDPI());
                textSwitcher_text.setSingleLine(true);
                textSwitcher_text.setEllipsize(TextUtils.TruncateAt.MARQUEE);
                textSwitcher_text.setMarqueeRepeatLimit(-1);
                textSwitcher_text.setHorizontallyScrolling(true);
                return textSwitcher_text;
            }
        });

    }

    //Undefined Size

    else {
        //  Toast.makeText(getActivity(), "undefined", Toast.LENGTH_SHORT).show();
        comapny_switcher.setFactory(new ViewSwitcher.ViewFactory() {
            public View makeView() {
                /** Set up the custom auto scrolling text view class for lengthy album names */
                AppTextView textSwitcher_text = new AppTextView(getActivity());
                textSwitcher_text.setTextColor(Color.argb(225, 245, 242, 11));
                textSwitcher_text.setTextSize(20 * functions.getScreenDPI());
                textSwitcher_text.setSingleLine(true);
                textSwitcher_text.setEllipsize(TextUtils.TruncateAt.MARQUEE);
                textSwitcher_text.setMarqueeRepeatLimit(-1);
                textSwitcher_text.setHorizontallyScrolling(true);
                return textSwitcher_text;
            }
        });
    }
    mProgressDialog.show();
    new LoadData().execute();

    // Gesture detection
    gestureDetector = new GestureDetector(getActivity(), new OnGestureListener() {

        public boolean onSingleTapUp(MotionEvent e) {
            return false;
        }

        public void onShowPress(MotionEvent e) {
        }

        public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
            return false;
        }

        public void onLongPress(MotionEvent e) {
        }

        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
            try {
                if (Math.abs(e1.getY() - e2.getY()) > AppGlobalVariables.SWIPE_MAX_OFF_PATH)
                    return false;
                /** Left swipe */
                if (e1.getX() - e2.getX() > AppGlobalVariables.SWIPE_MIN_DISTANCE
                        && Math.abs(velocityX) > AppGlobalVariables.SWIPE_THRESHOLD_VELOCITY) {
                    if (count < (MAX_COUNT - 1))
                        nextCompany();
                    else {
                        comapny_switcher.startAnimation(shake);
                        projects_list.startAnimation(shake);
                    }
                    /** Right Swipe */
                } else if (e2.getX() - e1.getX() > AppGlobalVariables.SWIPE_MIN_DISTANCE
                        && Math.abs(velocityX) > AppGlobalVariables.SWIPE_THRESHOLD_VELOCITY) {
                    if (count != 0)
                        previousComapny();
                    else {
                        comapny_switcher.startAnimation(shake);
                        projects_list.startAnimation(shake);
                    }
                }
            } catch (Exception e) {
            }

            return false;
        }

        public boolean onDown(MotionEvent e) {
            return false;
        }
    });

    gestureListener = new View.OnTouchListener() {
        public boolean onTouch(View v, MotionEvent event) {
            return gestureDetector.onTouchEvent(event);
        }
    };

    projects_list.setOnTouchListener(gestureListener);
    return mHolderView;
}

From source file:com.raja.knowme.FragmentQualification.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View mHolderView = inflater.inflate(R.layout.fragment_qualification, null);
    shake = AnimationUtils.loadAnimation(getActivity(), R.anim.shake);
    adapter = new QualificationListAdapter(getActivity());
    functions = new AppCommonFunctions(getActivity());
    pref = new AppPreferences(getActivity());
    knowmeData = new KnowMeDataObject(getActivity());
    mProgressDialog = new ProgressDialog(getActivity());
    mProgressDialog.setCancelable(false);
    mProgressDialog.setMessage(getString(R.string.loading));

    qualification_list = (ListView) mHolderView.findViewById(R.id.qualification_listview);
    institution_switcher = (TextSwitcher) mHolderView.findViewById(R.id.qualification_institution_name_text);
    instruction_btn = (RelativeLayout) mHolderView.findViewById(R.id.instrunstions_layout);

    qualification_list.setSelector(this.getResources().getDrawable(R.drawable.transparent_shape));

    if (!pref.getQualificationFirstRun()) {
        instruction_btn.setVisibility(RelativeLayout.GONE);
    }/*from  w w w  .jav  a 2s .co  m*/

    instruction_btn.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            pref.setQualificationRunned();
            instruction_btn.setVisibility(RelativeLayout.GONE);
        }
    });

    /*                 Multiple Screen Size Condition             */

    // Small Size

    if ((getContext().getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_SMALL) {
        // Toast.makeText(getActivity(), "small", Toast.LENGTH_SHORT).show();
        institution_switcher.setFactory(new ViewSwitcher.ViewFactory() {
            public View makeView() {
                /** Set up the custom auto scrolling text view class for lengthy album names */
                AppTextView textSwitcher_text = new AppTextView(getActivity());
                textSwitcher_text.setTextColor(Color.argb(225, 245, 242, 11));
                textSwitcher_text.setTextSize(16 * functions.getScreenDPI());
                textSwitcher_text.setSingleLine(true);
                textSwitcher_text.setEllipsize(TextUtils.TruncateAt.MARQUEE);
                textSwitcher_text.setMarqueeRepeatLimit(-1);
                textSwitcher_text.setHorizontallyScrolling(true);
                return textSwitcher_text;
            }
        });
    }

    //Normal Size

    else if ((getContext().getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL) {
        // Toast.makeText(getActivity(), "normal", Toast.LENGTH_SHORT).show();
        institution_switcher.setFactory(new ViewSwitcher.ViewFactory() {
            public View makeView() {
                /** Set up the custom auto scrolling text view class for lengthy album names */
                AppTextView textSwitcher_text = new AppTextView(getActivity());
                textSwitcher_text.setTextColor(Color.argb(225, 245, 242, 11));
                textSwitcher_text.setTextSize(14 * functions.getScreenDPI());
                textSwitcher_text.setSingleLine(true);
                textSwitcher_text.setEllipsize(TextUtils.TruncateAt.MARQUEE);
                textSwitcher_text.setMarqueeRepeatLimit(-1);
                textSwitcher_text.setHorizontallyScrolling(true);
                return textSwitcher_text;
            }
        });

    }

    // Large Size

    else if ((getContext().getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE) {
        // Toast.makeText(getActivity(), "large", Toast.LENGTH_SHORT).show();
        institution_switcher.setFactory(new ViewSwitcher.ViewFactory() {
            public View makeView() {
                /** Set up the custom auto scrolling text view class for lengthy album names */
                AppTextView textSwitcher_text = new AppTextView(getActivity());
                textSwitcher_text.setTextColor(Color.argb(225, 245, 242, 11));
                textSwitcher_text.setTextSize(32 * functions.getScreenDPI());
                textSwitcher_text.setSingleLine(true);
                textSwitcher_text.setEllipsize(TextUtils.TruncateAt.MARQUEE);
                textSwitcher_text.setMarqueeRepeatLimit(-1);
                textSwitcher_text.setHorizontallyScrolling(true);
                return textSwitcher_text;
            }
        });

    }

    //X-large Size

    else if ((getContext().getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE) {
        //   Toast.makeText(getActivity(), "xlarge", Toast.LENGTH_SHORT).show();
        institution_switcher.setFactory(new ViewSwitcher.ViewFactory() {
            public View makeView() {
                /** Set up the custom auto scrolling text view class for lengthy album names */
                AppTextView textSwitcher_text = new AppTextView(getActivity());
                textSwitcher_text.setTextColor(Color.argb(225, 245, 242, 11));
                textSwitcher_text.setTextSize(48 * functions.getScreenDPI());
                textSwitcher_text.setSingleLine(true);
                textSwitcher_text.setEllipsize(TextUtils.TruncateAt.MARQUEE);
                textSwitcher_text.setMarqueeRepeatLimit(-1);
                textSwitcher_text.setHorizontallyScrolling(true);
                return textSwitcher_text;
            }
        });

    }

    //Undefined Size

    else {
        //  Toast.makeText(getActivity(), "undefined", Toast.LENGTH_SHORT).show();
        institution_switcher.setFactory(new ViewSwitcher.ViewFactory() {
            public View makeView() {
                /** Set up the custom auto scrolling text view class for lengthy album names */
                AppTextView textSwitcher_text = new AppTextView(getActivity());
                textSwitcher_text.setTextColor(Color.argb(225, 245, 242, 11));
                textSwitcher_text.setTextSize(20 * functions.getScreenDPI());
                textSwitcher_text.setSingleLine(true);
                textSwitcher_text.setEllipsize(TextUtils.TruncateAt.MARQUEE);
                textSwitcher_text.setMarqueeRepeatLimit(-1);
                textSwitcher_text.setHorizontallyScrolling(true);
                return textSwitcher_text;
            }
        });

    }

    mProgressDialog.show();
    new LoadData().execute();

    // Gesture detection
    gestureDetector = new GestureDetector(getActivity(), new OnGestureListener() {

        public boolean onSingleTapUp(MotionEvent e) {
            return false;
        }

        public void onShowPress(MotionEvent e) {
        }

        public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
            return false;
        }

        public void onLongPress(MotionEvent e) {
        }

        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
            try {
                if (Math.abs(e1.getY() - e2.getY()) > AppGlobalVariables.SWIPE_MAX_OFF_PATH)
                    return false;
                /** Left swipe */
                if (e1.getX() - e2.getX() > AppGlobalVariables.SWIPE_MIN_DISTANCE
                        && Math.abs(velocityX) > AppGlobalVariables.SWIPE_THRESHOLD_VELOCITY) {
                    if (count < (MAX_COUNT - 1))
                        nextInstitution();
                    else {
                        institution_switcher.startAnimation(shake);
                        qualification_list.startAnimation(shake);
                    }
                    /** Right Swipe */
                } else if (e2.getX() - e1.getX() > AppGlobalVariables.SWIPE_MIN_DISTANCE
                        && Math.abs(velocityX) > AppGlobalVariables.SWIPE_THRESHOLD_VELOCITY) {
                    if (count != 0)
                        previousInstitution();
                    else {
                        institution_switcher.startAnimation(shake);
                        qualification_list.startAnimation(shake);
                    }
                }
            } catch (Exception e) {
            }

            return false;
        }

        public boolean onDown(MotionEvent e) {
            return false;
        }
    });

    gestureListener = new View.OnTouchListener() {
        public boolean onTouch(View v, MotionEvent event) {
            return gestureDetector.onTouchEvent(event);
        }
    };

    qualification_list.setOnTouchListener(gestureListener);
    return mHolderView;
}

From source file:tr.com.turkcellteknoloji.turkcellupdater.Utilities.java

@SuppressLint("NewApi")
static boolean isTablet(Context context) {
    if (android.os.Build.VERSION.SDK_INT > 12) {
        return context.getResources().getConfiguration().smallestScreenWidthDp > 600;
    } else if (android.os.Build.VERSION.SDK_INT > 10) {
        int size = context.getResources().getConfiguration().screenLayout
                & Configuration.SCREENLAYOUT_SIZE_MASK;
        return (size == Configuration.SCREENLAYOUT_SIZE_LARGE)
                || (size == Configuration.SCREENLAYOUT_SIZE_XLARGE);
    } else {/*from  w w  w  . j  a va2 s .c om*/
        return false;
    }
}

From source file:jfabrix101.lib.fragmentActivity.AbstractFragmentActivityController.java

/**
 * Check if the portrait mode is supported.
 * The default value verify the screen size. If the screen size is XLARGE or
 * the portrait mode is supported, otherwise not. 
 * //  w w w.j a v a2  s.  c  o m
 * If this method return false, in portrait mode will be shown
 * only the left fragment and clicking on an item, the activity will show 
 * the right fragment at full screen. (Smartphone behaviour).
 */
protected boolean isPortraitFragmentModeSupported() {
    int screenLayout = ActivityHelper.getScreenLayoutType(this);
    mLogger.trace("ScreenLayoutConfiguration : ", screenLayout);
    if (screenLayout > Configuration.SCREENLAYOUT_SIZE_LARGE)
        return true;
    else
        return false;
}