List of usage examples for android.content.pm ActivityInfo SCREEN_ORIENTATION_PORTRAIT
int SCREEN_ORIENTATION_PORTRAIT
To view the source code for android.content.pm ActivityInfo SCREEN_ORIENTATION_PORTRAIT.
Click Source Link
portrait
in the android.R.attr#screenOrientation attribute. From source file:com.maxwen.wallpaper.board.fragments.dialogs.WallpaperApplyFragment.java
@Override public void onDismiss(DialogInterface dialog) { if (Preferences.getPreferences(getActivity()).isScrollWallpaper()) { getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } else {/*from w w w.j a v a 2s .c o m*/ getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } super.onDismiss(dialog); }
From source file:com.melchor629.musicote.MainActivity.java
@Override public void onCreate(Bundle savedInstanceState) { // Set the user interface layout for this Activity // The layout file is defined in the project res/layout/main.xml file super.onCreate(savedInstanceState); setContentView(R.layout.main);//from w ww. ja v a 2s . co m appContext = getApplicationContext(); swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.mainLayout); swipeRefreshLayout.setOnRefreshListener(this); swipeRefreshLayout.setColorSchemeResources(R.color.colorAccent, R.color.colorPrimaryDark, R.color.colorGrey600); final ListView list = (ListView) findViewById(android.R.id.list); list.setOnScrollListener(new ListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { boolean enable = false; if (list != null && list.getChildCount() > 0) { // check if the first item of the list is visible boolean firstItemVisible = list.getFirstVisiblePosition() == 0; // check if the top of the first item is visible boolean topOfFirstItemVisible = list.getChildAt(0).getTop() == 0; // enabling or disabling the refresh layout enable = firstItemVisible && topOfFirstItemVisible; } swipeRefreshLayout.setEnabled(enable); } }); getActionBar().setIcon(R.drawable.ic_launcher); getActionBar().setDisplayUseLogoEnabled(true); // La app prueba en busca de la direccin correcta WifiManager mw = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo wi = mw.getConnectionInfo(); String SSID = wi.getSSID(); Log.i("MainActivity", "Wifi conectado: " + SSID + " " + (SSID != null ? SSID.equals("Madrigal") : "")); if (SSID == null) { SSID = ""; Toast.makeText(this, getString(R.string.no_wifi), Toast.LENGTH_LONG).show(); } if (SSID.equals("Madrigal") || SSID.contains("Madrigal") || System.getProperty("os.version").equals("3.4.67+")) { MainActivity.HOST = "192.168.1.133"; } else { MainActivity.HOST = "reinoslokos.no-ip.org"; } Log.i("MainActivity", "HOST: " + HOST); //Deletes the notification if remains (BUG) NotificationManager mn = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); if (Reproductor.a == -1) mn.cancel(1); mn.cancel(3); //Revisa la base de datos DB mDbHelper = new DB(getBaseContext()); SQLiteDatabase db = mDbHelper.getWritableDatabase(); //Actualizacin de la lista if (mDbHelper.isNecesaryUpgrade(db) && Utils.HostTest(HOST) == 200) async(); else cursordb(db); db.close(); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
From source file:com.rsegismont.androlife.home.HomeActivity.java
private void setupUi() { final int orientation = getResources().getConfiguration().orientation; final boolean isTablet = SdkUtils.isATablet(getApplicationContext()); setContentView(R.layout.androlife_navigation); View leftDrawer;// ww w . ja v a 2 s . c o m if (orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); } if ((orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) || (!isTablet)) { getSupportActionBar().setSubtitle(R.string.home_menu_closed); leftDrawer = findViewById(R.id.left_drawer); if (isTablet) { leftDrawer.getLayoutParams().width = (1 * this.width / 2); } else { leftDrawer.getLayoutParams().width = (3 * this.width / 4); } this.mDrawerLayout = ((DrawerLayout) findViewById(R.id.drawer_layout)); this.mDrawerLayout.setDrawerShadow(getResources().getDrawable(R.drawable.drawer_shadow), Gravity.LEFT); this.mDrawerToggle = new ActionBarDrawerToggle(this, this.mDrawerLayout, R.drawable.ic_drawer, R.string.home_menu_open, R.string.home_menu_closed); this.mDrawerLayout.setDrawerListener(new DrawerListener() { private int progressState = 0; @Override public void onDrawerStateChanged(int arg0) { } @Override public void onDrawerSlide(View arg0, float arg1) { if ((arg1 >= 0.5f) && (this.progressState == 0)) { this.progressState = 1; getSupportActionBar().setSubtitle(R.string.home_menu_open); } else if ((arg1 < 0.5f) && (this.progressState == 1)) { this.progressState = 0; getSupportActionBar().setSubtitle(R.string.home_menu_closed); } } @Override public void onDrawerOpened(View arg0) { this.progressState = 1; } @Override public void onDrawerClosed(View arg0) { this.progressState = 0; } }); } mHorizontalMargin = getResources().getDimensionPixelSize(R.dimen.common_margin_horizontal); mVerticalMargin = getResources().getDimensionPixelSize(R.dimen.common_margin_vertical); initMenuFragment(); if ((LinearLayout) findViewById(R.id.main_frag_list) != null) { homeGridFragment = new HomeProgrammesGridFragment(); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.replace(R.id.main_frag_list, homeGridFragment, PREFIX_TAG_PROGRAMMES); transaction.commit(); if (homeGridFragmentAdapter != null) { onLoadFinishedInternal(); } } }
From source file:org.gluu.super_gluu.app.fingerprint.FingerprintAuthenticationDialogFragment.java
@Override public void onResume() { super.onResume(); if (mStage == Stage.FINGERPRINT) { mFingerprintUiHelper.startListening(mCryptoObject); }//w ww .ja v a 2s . c om getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
From source file:com.supremainc.biostar2.base.BaseActivity.java
@SuppressLint("ShowToast") @Override/*from ww w.ja v a 2s . c om*/ protected void onCreate(Bundle savedInstanceState) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); super.onCreate(savedInstanceState); mContext = this; mResouce = mContext.getResources(); mPopup = new Popup(mContext); mToastPopup = new ToastPopup(mContext); mUserDataProvider = UserDataProvider.getInstance(mContext); mDeviceDataProvider = DeviceDataProvider.getInstance(mContext); mDoorDataProvider = DoorDataProvider.getInstance(mContext); mEventDataProvider = EventDataProvider.getInstance(mContext); mAccessGroupDataProvider = AccessGroupDataProvider.getInstance(mContext); mAccessLevelDataProvider = AccessLevelDataProvider.getInstance(mContext); mPermissionDataProvider = PermissionDataProvider.getInstance(mContext); mCommonDataProvider = CommonDataProvider.getInstance(mContext); mPushProvider = PushDataProvider.getInstance(this); mAppDataProvider = AppDataProvider.getInstance(mContext); if (BuildConfig.DEBUG) { if (savedInstanceState == null) { Log.e(TAG, "onCreate savedInstanceState is null"); } else { Log.e(TAG, "onCreate savedInstanceState is not null"); } } if (!mCommonDataProvider.isValidLogin() && !mIsResumCheckSkip) { if (BuildConfig.DEBUG) { Log.e(TAG, "onCreate memory is cleard"); } // mPopup.show(PopupType.ALERT, getString(R.string.info),getString(R.string.login_expire), popupListener, getString(R.string.ok), null); } if (mClearReceiver == null) { mClearReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (isFinishing()) { return; } final String action = intent.getAction(); if (BuildConfig.DEBUG) { Log.e(TAG, "receive:" + action); } if (action.equals(Setting.BROADCAST_CLEAR) || action.equals(Setting.BROADCAST_ALL_CLEAR)) { finish(); } } }; IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(Setting.BROADCAST_CLEAR); intentFilter.addAction(Setting.BROADCAST_ALL_CLEAR); LocalBroadcastManager.getInstance(this).registerReceiver(mClearReceiver, intentFilter); } }
From source file:com.alexcruz.papuhwalls.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { this.Preferences = new Preferences(getApplicationContext()); super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); context = this; CustomActivityOnCrash.install(this); prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); if (prefs.getBoolean(Preferences.IS_FIRST__RUN, true)) { startActivity(new Intent(this, Slides.class)); finish();/*from w w w . j av a2s. co m*/ } if (Build.VERSION.SDK_INT >= 23 && PermissionChecker.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PermissionChecker.PERMISSION_GRANTED) { requestPermissions(new String[] { Manifest.permission.READ_EXTERNAL_STORAGE }, REQUEST_READ_STORAGE_PERMISSION); } else { // Do absolutely NOTHING } final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); com.alexcruz.papuhwalls.Preferences.themeMe(this, toolbar); Home = getResources().getString(R.string.app_name); final String Home = getResources().getString(R.string.section_home); AllWalls = getResources().getString(R.string.section_all_walls); AndroidWalls = getResources().getString(R.string.section_android_walls); BwWalls = getResources().getString(R.string.section_bw_walls); BlurWalls = getResources().getString(R.string.section_blur_walls); CloudsWalls = getResources().getString(R.string.section_clouds_walls); MiscWalls = getResources().getString(R.string.section_misc_walls); MustachesWalls = getResources().getString(R.string.section_mustaches_walls); NexusWalls = getResources().getString(R.string.section_nexus_walls); OriginalWalls = getResources().getString(R.string.section_original_walls); PapuhWalls = getResources().getString(R.string.section_papuh_walls); SolidsWalls = getResources().getString(R.string.section_solids_walls); StarsWalls = getResources().getString(R.string.section_stars_walls); RomCategory = getResources().getString(R.string.section_rom_category); AicpWalls = getResources().getString(R.string.section_aicp_walls); BrokenOsWalls = getResources().getString(R.string.section_brokenos_walls); CandyWalls = getResources().getString(R.string.section_candy_walls); DuWalls = getResources().getString(R.string.section_du_walls); EosWalls = getResources().getString(R.string.section_eos_walls); LiquidsmoothWalls = getResources().getString(R.string.section_liquidsmooth_walls); OmniWalls = getResources().getString(R.string.section_omni_walls); OrionWalls = getResources().getString(R.string.section_orion_walls); PaWalls = getResources().getString(R.string.section_pa_walls); PacromWalls = getResources().getString(R.string.section_pacrom_walls); RrWalls = getResources().getString(R.string.section_rr_walls); SlimWalls = getResources().getString(R.string.section_slim_walls); TeslaWalls = getResources().getString(R.string.section_tesla_walls); TwistedAOSPWalls = getResources().getString(R.string.section_twistedaosp_walls); ValidusWalls = getResources().getString(R.string.section_validus_walls); Settings = getResources().getString(R.string.settings); LiveWallpaper = getResources().getString(R.string.live_wallpaper_description); MuzeiSettings = getResources().getString(R.string.muzei_settings); AboutApp = getResources().getString(R.string.section_aboutapp); currentItem = 1; final IProfile profile = new ProfileDrawerItem().withName("Alex Cruz aka Mazda") .withIcon(getResources().getDrawable(R.drawable.alexcruz)).withIdentifier(1); int header = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(getString(R.string.time_context_headers), false)) { if (header < TIME_SUNRISE || header >= TIME_NIGHT) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_night; } else { header = R.drawable.night; } } else if (header >= TIME_SUNRISE && header < TIME_MORNING) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_sunrise; } else { header = R.drawable.sunrise; } } else if (header >= TIME_MORNING && header < TIME_NOON) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_morning; } else { header = R.drawable.morning; } } else if (header >= TIME_NOON && header < TIME_AFTERNOON) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_noon; } else { header = R.drawable.noon; } } else if (header >= TIME_AFTERNOON && header < TIME_SUNSET) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_afternoon; } else { header = R.drawable.afternoon; } } else if (header >= TIME_SUNSET && header < TIME_NIGHT) { if (PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(getString(R.string.poly_time_context_headers), false)) { header = R.drawable.poly_sunset; } else { header = R.drawable.sunset; } } } else { header = R.drawable.header; } String versionName; try { versionName = getPackageManager().getPackageInfo(getPackageName(), 0).versionName; } catch (Exception e) { throw new RuntimeException(e); } headerResult = new AccountHeaderBuilder().withActivity(this).withHeaderBackground(header) .withSelectionFirstLine(getResources().getString(R.string.app_long_name)) .withSelectionSecondLine("v" + versionName).withSelectionListEnabledForSingleProfile(false) .addProfiles(profile).withOnAccountHeaderListener(new AccountHeader.OnAccountHeaderListener() { @Override public boolean onProfileChanged(View view, IProfile profile, boolean current) { if (profile instanceof IDrawerItem && ((IDrawerItem) profile).getIdentifier() == PROFILE_SETTING) { int count = 100 + headerResult.getProfiles().size() + 1; if (headerResult.getProfiles() != null) { Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { getResources().getString(R.string.email_address) }); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getResources().getText(R.string.artsource_name)); emailIntent.setType("plain/text"); startActivity(Intent.createChooser(emailIntent, "Contact Alex")); } else { headerResult.addProfiles(profile); } } return false; } }).withSavedInstance(savedInstanceState).build(); result = new DrawerBuilder().withActivity(this).withToolbar(toolbar).withAccountHeader(headerResult) .withHeader(R.layout.header).withSavedInstance(savedInstanceState).withScrollToTopAfterClick(true) .withFooterDivider(true).withSliderBackgroundColor(Preferences.Drawer()) .withStatusBarColor( Preferences.StatusBarTint() ? tint(Preferences.Theme(), 0.8) : Preferences.Theme()) .addDrawerItems( new PrimaryDrawerItem().withName(Home).withIcon(R.drawable.ic_home) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(1), new PrimaryDrawerItem().withName(AllWalls).withIcon(R.drawable.ic_allwalls) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(2).withBadge("1630+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(AndroidWalls).withIcon(R.drawable.ic_android) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(3).withBadge("17+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(BwWalls).withIcon(R.drawable.ic_bw) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(4).withBadge("56+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(BlurWalls).withIcon(R.drawable.ic_blur) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(5).withBadge("10+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(CloudsWalls).withIcon(R.drawable.ic_clouds) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(6).withBadge("60+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(MiscWalls).withIcon(R.drawable.ic_misc) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(7).withBadge("41+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(MustachesWalls).withIcon(R.drawable.ic_mustaches) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(8).withBadge("10+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(NexusWalls).withIcon(R.drawable.ic_nexus) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(9).withBadge("98+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(OriginalWalls).withIcon(R.drawable.ic_original) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(10).withBadge("343+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(PapuhWalls).withIcon(R.drawable.ic_papuh) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(11).withBadge("24+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(SolidsWalls).withIcon(R.drawable.ic_solids) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(12).withBadge("72+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(StarsWalls).withIcon(R.drawable.ic_stars) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(13).withBadge("11+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new SectionDrawerItem().withName(RomCategory).withTypeface(Typeface.DEFAULT_BOLD) .withTextColor(Preferences.DrawerText()), new PrimaryDrawerItem().withName(AicpWalls).withIcon(R.drawable.ic_aicp) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(15).withBadge("84+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(BrokenOsWalls).withIcon(R.drawable.ic_brokenos) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(16).withBadge("53+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(CandyWalls).withIcon(R.drawable.ic_candy) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(17).withBadge("80+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(DuWalls).withIcon(R.drawable.ic_dirtyunicorns) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(18).withBadge("139+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(EosWalls).withIcon(R.drawable.ic_eos) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(19).withBadge("48+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(LiquidsmoothWalls).withIcon(R.drawable.ic_liquidsmooth) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(20).withBadge("65+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(OmniWalls).withIcon(R.drawable.ic_omni) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(21).withBadge("29+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(OrionWalls).withIcon(R.drawable.ic_orion) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(22).withBadge("10+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(PaWalls).withIcon(R.drawable.ic_pa) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(23).withBadge("10+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(PacromWalls).withIcon(R.drawable.ic_pacrom) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(24).withBadge("21+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(RrWalls).withIcon(R.drawable.ic_rr) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(25).withBadge("54+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(SlimWalls).withIcon(R.drawable.ic_slim) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(26).withBadge("8+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(TeslaWalls).withIcon(R.drawable.ic_tesla) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(27).withBadge("43+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(TwistedAOSPWalls).withIcon(R.drawable.ic_twistedaosp) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(28).withBadge("43+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new PrimaryDrawerItem().withName(ValidusWalls).withIcon(R.drawable.ic_validus) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(29).withBadge("258+") .withBadgeStyle(new BadgeStyle().withTextColor(Preferences.BadgeText()) .withColor(Preferences.BadgeBackground())), new DividerDrawerItem(), new SecondaryDrawerItem().withName(Settings).withIcon(R.drawable.ic_settings) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(30), new SecondaryDrawerItem().withName(LiveWallpaper) .withIcon(R.drawable.ic_device_now_wallpaper).withIconTintingEnabled(true) .withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(33), new SecondaryDrawerItem().withName(MuzeiSettings).withIcon(R.drawable.ic_muzei) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(31), new SecondaryDrawerItem().withName(AboutApp).withIcon(R.drawable.ic_about) .withIconTintingEnabled(true).withSelectedIconColor(Preferences.SelectedIcon()) .withIconColor(Preferences.NormalIcon()) .withSelectedTextColor(tint(Preferences.SelectedDrawerText(), 1.0)) .withSelectedColor(tint(Preferences.DrawerSelector(), 1.0)) .withTextColor(Preferences.DrawerText()).withIdentifier(32)) .withOnDrawerListener(new Drawer.OnDrawerListener() { @Override public void onDrawerOpened(View drawerView) { } @Override public void onDrawerClosed(View drawerView) { } @Override public void onDrawerSlide(View drawerView, float slideOffset) { } }).withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { @Override public boolean onItemClick(View view, int position, IDrawerItem drawerItem) { boolean isMuzeiInstalled = Preferences.isAppInstalled(context, "net.nurik.roman.muzei"); boolean isConnected = isConnected(MainActivity.this); if (drawerItem != null) { switch (drawerItem.getIdentifier()) { case 1: switchFragment(1, Home, "BaseActivity"); break; case 2: if (isConnected) { switchWalls(2, AllWalls, "AllWalls"); } else { showNotConnectedDialog(); } break; case 3: if (isConnected) { switchWalls(3, AndroidWalls, "AndroidWalls"); } else { showNotConnectedDialog(); } break; case 4: if (isConnected) { switchWalls(4, BwWalls, "BwWalls"); } else { showNotConnectedDialog(); } break; case 5: if (isConnected) { switchWalls(5, BlurWalls, "BlurWalls"); } else { showNotConnectedDialog(); } break; case 6: if (isConnected) { switchWalls(6, BwWalls, "CloudsWalls"); } else { showNotConnectedDialog(); } break; case 7: if (isConnected) { switchWalls(7, MiscWalls, "MiscWalls"); } else { showNotConnectedDialog(); } break; case 8: if (isConnected) { switchWalls(8, MustachesWalls, "MustachesWalls"); } else { showNotConnectedDialog(); } break; case 9: if (isConnected) { switchWalls(9, NexusWalls, "NexusWalls"); } else { showNotConnectedDialog(); } break; case 10: if (isConnected) { switchWalls(10, OriginalWalls, "OriginalWalls"); } else { showNotConnectedDialog(); } break; case 11: if (isConnected) { switchWalls(11, PapuhWalls, "PapuhWalls"); } else { showNotConnectedDialog(); } break; case 12: if (isConnected) { switchWalls(12, SolidsWalls, "SolidsWalls"); } else { showNotConnectedDialog(); } break; case 13: if (isConnected) { switchWalls(13, StarsWalls, "StarsWalls"); } else { showNotConnectedDialog(); } break; case 14: setTitle(R.string.section_rom_category); ; break; case 15: if (isConnected) { switchWalls(15, AicpWalls, "AicpWalls"); } else { showNotConnectedDialog(); } break; case 16: if (isConnected) { switchWalls(16, BrokenOsWalls, "BrokenOsWalls"); } else { showNotConnectedDialog(); } break; case 17: if (isConnected) { switchWalls(17, CandyWalls, "CandyWalls"); } else { showNotConnectedDialog(); } break; case 18: if (isConnected) { switchWalls(18, DuWalls, "DuWalls"); } else { showNotConnectedDialog(); } break; case 19: if (isConnected) { switchWalls(19, EosWalls, "EosWalls"); } else { showNotConnectedDialog(); } break; case 20: if (isConnected) { switchWalls(20, LiquidsmoothWalls, "LiquidsmoothWalls"); } else { showNotConnectedDialog(); } break; case 21: if (isConnected) { switchWalls(21, OmniWalls, "OmniWalls"); } else { showNotConnectedDialog(); } break; case 22: if (isConnected) { switchWalls(22, OrionWalls, "OrionWalls"); } else { showNotConnectedDialog(); } break; case 23: if (isConnected) { switchWalls(23, PaWalls, "PaWalls"); } else { showNotConnectedDialog(); } break; case 24: if (isConnected) { switchWalls(24, PacromWalls, "PacromWalls"); } else { showNotConnectedDialog(); } break; case 25: if (isConnected) { switchWalls(25, RrWalls, "RrWalls"); } else { showNotConnectedDialog(); } break; case 26: if (isConnected) { switchWalls(26, SlimWalls, "SlimWalls"); } else { showNotConnectedDialog(); } break; case 27: if (isConnected) { switchWalls(27, TeslaWalls, "TeslaWalls"); } else { showNotConnectedDialog(); } break; case 28: if (isConnected) { switchWalls(28, TwistedAOSPWalls, "TwistedAOSPWalls"); } else { showNotConnectedDialog(); } break; case 29: if (isConnected) { switchWalls(29, ValidusWalls, "ValidusWalls"); } else { showNotConnectedDialog(); } break; case 30: Intent SettingsIntent = new Intent(MainActivity.this, SettingsActivity.class); startActivityForResult(SettingsIntent, 0); break; case 31: if (isMuzeiInstalled) { Intent launchMuzeiIntent = new Intent(MainActivity.this, Settings.class); startActivityForResult(launchMuzeiIntent, 0); } else { // Do absolutely NOTHING } break; case 32: switchFragment(32, AboutApp, "Credits"); break; case 33: Intent LWIntent = new Intent(MainActivity.this, com.alexcruz.papuhwalls.Live.Settings.class); startActivityForResult(LWIntent, 0); break; } } return false; } }).withOnDrawerItemLongClickListener(new Drawer.OnDrawerItemLongClickListener() { @Override public boolean onItemLongClick(View view, int position, IDrawerItem drawerItem) { if (drawerItem instanceof SecondaryDrawerItem) { } return false; } }).build(); result.setSelection(1, true); boolean isMuzeiInstalled = Preferences.isAppInstalled(context, "net.nurik.roman.muzei"); if (!isMuzeiInstalled) { result.removeItem(31); } else { // Do absolutely NOTHING } if (Preferences.getLiveWalls().size() == 0 & isConnected(this)) new SetupLW(this).execute(); }
From source file:org.LK8000.LK8000.java
@Override protected void onCreate(Bundle savedInstanceState) { if (serviceClass == null) serviceClass = MyService.class; super.onCreate(savedInstanceState); // Fabric.with(this, new Crashlytics(), new CrashlyticsNdk()); Fabric fabric = new Fabric.Builder(this).debuggable(true).kits(new Crashlytics(), new CrashlyticsNdk()) .build();/*from w ww. j a v a2 s . c om*/ Fabric.with(fabric); Log.d(TAG, "ABI=" + Build.CPU_ABI); Log.d(TAG, "PRODUCT=" + Build.PRODUCT); Log.d(TAG, "MANUFACTURER=" + Build.MANUFACTURER); Log.d(TAG, "MODEL=" + Build.MODEL); Log.d(TAG, "DEVICE=" + Build.DEVICE); Log.d(TAG, "BOARD=" + Build.BOARD); Log.d(TAG, "FINGERPRINT=" + Build.FINGERPRINT); if (!Loader.loaded) { TextView tv = new TextView(this); tv.setText("Failed to load the native LK8000 libary.\n" + "Report this problem to us, and include the following information:\n" + "ABI=" + Build.CPU_ABI + "\n" + "PRODUCT=" + Build.PRODUCT + "\n" + "FINGERPRINT=" + Build.FINGERPRINT + "\n" + "error=" + Loader.error); setContentView(tv); return; } initialiseNative(); NetUtil.initialise(this); InternalGPS.Initialize(); NonGPSSensors.Initialize(); IOIOHelper.onCreateContext(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) // Bluetooth suppoert was added in Android 2.0 "Eclair" BluetoothHelper.Initialize(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) // the DownloadManager was added in Android 2.3 "Gingerbread" DownloadUtil.Initialise(getApplicationContext()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { UsbSerialHelper.Initialise(this); } SoundUtil.Initialise(); // fullscreen mode requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().addFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); /* Workaround for layout problems in Android KitKat with immersive full screen mode: Sometimes the content view was not initialized with the correct size, which caused graphics artifacts. */ if (android.os.Build.VERSION.SDK_INT >= 19) { getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); } enableImmersiveModeIfSupported(); TextView tv = new TextView(this); tv.setText("Loading LK8000..."); setContentView(tv); batteryReceiver = new BatteryReceiver(); registerReceiver(batteryReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); SharedPreferences settings = getSharedPreferences("LK8000", 0); int screenOrientation = settings.getInt("screenOrientation", 0); switch (screenOrientation) { case 0: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); break; case 1: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); break; case 2: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); break; case 3: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); break; case 4: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); break; default: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); } getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); }
From source file:com.undatech.opaque.RemoteCanvasActivity.java
@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); // TODO: Implement left-icon //requestWindowFeature(Window.FEATURE_LEFT_ICON); //setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); handler = new Handler(); setContentView(R.layout.canvas);/*from www.j av a 2s . co m*/ canvas = (RemoteCanvas) findViewById(R.id.canvas); Intent i = getIntent(); String vvFileName = startSessionFromVvFile(i); if (vvFileName == null) { android.util.Log.d(TAG, "Initializing session from connection settings."); connection = (ConnectionSettings) i.getSerializableExtra("com.undatech.opaque.ConnectionSettings"); canvas.initialize(connection); } else { canvas.initialize(vvFileName, connection); } canvas.setOnKeyListener(this); canvas.setFocusableInTouchMode(true); canvas.setDrawingCacheEnabled(false); // If rotation is disabled, fix the orientation to the current one. if (!connection.isRotationEnabled()) { int orientation = getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_LANDSCAPE) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } } // This code detects when the soft keyboard is up and sets an appropriate visibleHeight in the canvas. // When the keyboard is gone, it resets visibleHeight and pans zero distance to prevent us from being // below the desktop image (if we scrolled all the way down when the keyboard was up). // TODO: Move this into a separate thread, and post the visibility changes to the handler. // to avoid occupying the UI thread with this. final View rootView = ((ViewGroup) findViewById(android.R.id.content)).getChildAt(0); rootView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { Rect r = new Rect(); rootView.getWindowVisibleDisplayFrame(r); // To avoid setting the visible height to a wrong value after an screen unlock event // (when r.bottom holds the width of the screen rather than the height due to a rotation) // we make sure r.top is zero (i.e. there is no notification bar and we are in full-screen mode) // It's a bit of a hack. if (r.top == 0) { if (canvas.myDrawable != null) { canvas.setVisibleDesktopHeight(r.bottom); canvas.relativePan(0, 0); } } // Enable/show the zoomer if the keyboard is gone, and disable/hide otherwise. // We detect the keyboard if more than 19% of the screen is covered. int offset = 0; int rootViewHeight = rootView.getHeight(); if (r.bottom > rootViewHeight * 0.81) { offset = rootViewHeight - r.bottom; // Soft Kbd gone, shift the meta keys and arrows down. if (layoutKeys != null) { layoutKeys.offsetTopAndBottom(offset); keyStow.offsetTopAndBottom(offset); if (prevBottomOffset != offset) { setExtraKeysVisibility(View.GONE, false); canvas.invalidate(); kbdIcon.enable(); } } } else { offset = r.bottom - rootViewHeight; // Soft Kbd up, shift the meta keys and arrows up. if (layoutKeys != null) { layoutKeys.offsetTopAndBottom(offset); keyStow.offsetTopAndBottom(offset); if (prevBottomOffset != offset) { setExtraKeysVisibility(View.VISIBLE, true); canvas.invalidate(); kbdIcon.hide(); kbdIcon.disable(); } } } setKeyStowDrawableAndVisibility(); prevBottomOffset = offset; } }); kbdIcon = (ZoomControls) findViewById(R.id.zoomer); kbdIcon.hide(); kbdIcon.setOnZoomKeyboardClickListener(new View.OnClickListener() { @Override public void onClick(View v) { InputMethodManager inputMgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMgr.toggleSoftInput(0, 0); } }); // Initialize and define actions for on-screen keys. initializeOnScreenKeys(); myVibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE); // Initialize map from XML IDs to input handlers. inputHandlerIdMap = new HashMap<Integer, InputHandler>(); inputHandlerIdMap.put(R.id.inputMethodDirectSwipePan, new InputHandlerDirectSwipePan(this, canvas, myVibrator)); inputHandlerIdMap.put(R.id.inputMethodDirectDragPan, new InputHandlerDirectDragPan(this, canvas, myVibrator)); inputHandlerIdMap.put(R.id.inputMethodTouchpad, new InputHandlerTouchpad(this, canvas, myVibrator)); inputHandlerIdMap.put(R.id.inputMethodSingleHanded, new InputHandlerSingleHanded(this, canvas, myVibrator)); android.util.Log.e(TAG, "connection.getInputMethod(): " + connection.getInputMethod()); inputHandler = idToInputHandler(connection.getInputMethod()); }
From source file:reportsas.com.formulapp.Formulario.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.activity_formulario); Bundle bundle = getIntent().getExtras(); idFormulario = bundle.getString("formulario"); setTitle("Formulario " + idFormulario); dbAdapter = new FormDbAdapter(this); txtTitulo = (TextView) findViewById(R.id.txtTitulo); txtDescrip = (TextView) findViewById(R.id.txtDescripcion); prueba = (TextView) findViewById(R.id.prueba); layout = (ViewGroup) findViewById(R.id.content); try {// ww w . ja v a 2 s . co m dbAdapter.abrir(); encuesta = dbAdapter.formFind(this, idFormulario); rePaintMenu = 1; invalidateOptionsMenu(); if (encuesta != null) { txtTitulo.setText(encuesta.getTitulo()); txtDescrip.setText(encuesta.getDescripcion()); } for (int i = 0; i < encuesta.getPreguntas().size(); i++) { addPreguntas(encuesta.getPreguntas().get(i)); } dbAdapter.cerrar(); } catch (SQLException e) { e.printStackTrace(); } }
From source file:com.gochina.jclient.ui.LauncherActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { int pid = android.os.Process.myPid(); if (mLauncherUI != null) { LogUtil.i(LogUtil.getLogUtilsTag(LauncherActivity.class), "finish last LauncherUI"); mLauncherUI.finish();/*from ww w. java2 s .com*/ } mLauncherUI = this; mLauncherInstanceCount++; super.onCreate(savedInstanceState); initWelcome(); mOverflowHelper = new OverflowHelper(this); // umeng MobclickAgent.updateOnlineConfig(this); MobclickAgent.setDebugMode(true); // ?? setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); ECContentObservers.getInstance().initContentObserver(); }