Example usage for android.view Window FEATURE_NO_TITLE

List of usage examples for android.view Window FEATURE_NO_TITLE

Introduction

In this page you can find the example usage for android.view Window FEATURE_NO_TITLE.

Prototype

int FEATURE_NO_TITLE

To view the source code for android.view Window FEATURE_NO_TITLE.

Click Source Link

Document

Flag for the "no title" feature, turning off the title at the top of the screen.

Usage

From source file:edu.stanford.mobisocial.dungbeetle.ImageGalleryActivity.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    mCorralClient = CorralClient.getInstance(this);
    mFeedUri = getIntent().getData();//www .j a va  2  s.  c  o  m
    long hash = getIntent().getLongExtra("objHash", -1);
    if (hash == -1) {
        toast("No image to view!");
        finish();
        return;
    }
    DbObj obj = App.instance().getMusubi().objForHash(hash);
    if (obj == null) {
        toast("Image does not exist!");
        finish();
        return;
    }
    mInitialObjId = obj.getLocalId();

    getSupportLoaderManager().initLoader(0, null, this);
    mGallery = new SlowGallery(this);
    mGallery.setBackgroundColor(Color.BLACK);
    addContentView(mGallery, CommonLayouts.FULL_SCREEN);
    if (savedInstanceState != null) {
        mInitialSelection = savedInstanceState.getInt("selection");
    }
}

From source file:net.dian1.player.activity.BrowsePlaylistActivity.java

/** Called when the activity is first created. */
@Override/* w w w .  j  a  v a  2s  .c o  m*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.browse_playlist);

    mPlaylistsListView = (ListView) findViewById(R.id.PlaylistsListView);
    mPlaylistsListView.setOnItemLongClickListener(mItemLongClick);
    mButton = (Button) findViewById(R.id.BrowseButton);
    mEditText = (EditText) findViewById(R.id.BrowseEditText);
    mViewFlipper = (ViewFlipper) findViewById(R.id.BrowsePlaylistViewFlipper);

    setupMode((Mode) getIntent().getSerializableExtra("mode"));

    mGestureOverlayView = (GestureOverlayView) findViewById(R.id.gestures);
    mGestureOverlayView.addOnGesturePerformedListener(Dian1Application.getInstance().getPlayerGestureHandler());
}

From source file:com.egloos.hyunyi.musicinfo.LinkPopUp.java

@Override
public void onCreate(Bundle saveInstanceState) {
    super.onCreate(saveInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    Bundle b = getIntent().getExtras();/*  w ww .  j  av  a2 s. com*/

    SharedPreferences prefs = getSharedPreferences("settings", MODE_PRIVATE);

    imageOptions = new DisplayImageOptions.Builder().cacheInMemory(false).cacheOnDisk(true)
            .bitmapConfig(Bitmap.Config.RGB_565).imageScaleType(ImageScaleType.EXACTLY)
            .showImageOnLoading(R.drawable.connecting_anim).build();
    config = new ImageLoaderConfiguration.Builder(getApplicationContext()).diskCacheExtraOptions(480, 320, null)
            .defaultDisplayImageOptions(imageOptions).build();

    if (imageLoader == null)
        imageLoader = ImageLoader.getInstance();
    if (!imageLoader.isInited())
        imageLoader.init(config);

    setContentView(R.layout.link_dialog);

    imageFrame = (FrameLayout) findViewById(R.id.image_frame);
    iBottomPanel = (ImageView) findViewById(R.id.bottom_panel);

    lArtistLink = (RelativeLayout) findViewById(R.id.l_artist_link);

    bPopUpClose = (ImageView) findViewById(R.id.b_popup_close);
    bPopUpClose.setOnClickListener(this);

    tEchoNest = (TextView) findViewById(R.id.t_echo_nest);
    tAttribution = (TextView) findViewById(R.id.t_attribution);

    tArtistName = (TextView) findViewById(R.id.t_artist_name);
    tArtistName.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
                //isMove = false;
                mTouchX = event.getRawX();
                mTouchY = event.getRawY();
                break;

            case MotionEvent.ACTION_UP:
                //Log.i("musicInfo", "ACTION_UP! TouchY:" + mTouchY + " UpY: " + event.getRawY() + " Move: " + (mTouchY - event.getRawY()));
                int RawY = (int) event.getRawY();
                int dY = (int) (mTouchY - event.getRawY());
                if (dY > 200) {
                    imageLoader.resume();
                    //Log.i("musicInfo", "mGridView TOP = " + mGridView.getTop() + " mGridView TransitionY =" + mGridView.getTranslationY());
                    while (mGridView.getTranslationY() > tArtistName.getHeight()) {
                        //Log.i("musicInfo", "Moving UP! mGridView: " + mGridView.getTranslationY() + " tArtistName: " + tArtistName.getTranslationY());
                        mGridView.setTranslationY(mGridView.getTranslationY() - 1);
                        tArtistName.setTranslationY(tArtistName.getTranslationY() - 1);

                    }
                } else if (dY > 5 && dY <= 200 || (dY <= 5 && tArtistName.getTranslationY() < 0)) {
                    while (tArtistName.getTranslationY() < 0) {
                        //Log.i("musicInfo", "Moving DOWN! mGridView: " + mGridView.getTranslationY() + " tArtistName: " + tArtistName.getTranslationY());
                        mGridView.setTranslationY(mGridView.getTranslationY() + 1);
                        tArtistName.setTranslationY(tArtistName.getTranslationY() + 1);
                    }
                    imageLoader.pause();
                }
                break;

            case MotionEvent.ACTION_MOVE:
                //isMove = true;

                //int top = tArtistName.getTop();
                //int bottom = tArtistName.getBottom();
                //int left = tArtistName.getLeft();
                //int right = tArtistName.getRight();

                int x = (int) (event.getRawX() - mTouchX);
                int y = (int) (event.getRawY() - mTouchY);

                final int num = 5;
                if (y > -num && y < num) {
                    //isMove = false;
                    break;
                } else if (y > 0) {

                } else {
                    imageFrame.bringChildToFront(mGridView);
                    tArtistName.setTranslationY((float) y);
                    mGridView.setTranslationY((float) (SGVtransition + y));

                    //Log.i("musicInfo", String.format("T: %d, B: %d", mGridView.getTop(), mGridView.getBottom()));

                }

                break;
            }
            return true;
        }
    });

    ArtistImage = (ImageView) findViewById(R.id.artist_image);

    lLinkList = (LinearLayout) findViewById(R.id.l_link_list);

    mGridView = (StaggeredGridView) findViewById(R.id.SG_view);

    SGVtransition = 900;

    mGridView.setTranslationY(SGVtransition);

    JSONObject artist_info = null;
    try {
        artist_info = new JSONObject(b.getString("artist_info"));
        Log.i("musicInfo", "LinkPopUp. OnCreate" + artist_info.toString());
        displayArtistInfo(artist_info);
    } catch (JSONException e) {
        e.printStackTrace();
    }

    if (artist_info != null)
        jArtists.put(artist_info);
    if (prefs.getBoolean("SimilarOn", false)) {
        getSimilarArtistsInfo((String) tArtistName.getText());
        ArtistImage.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {

                switch (event.getAction()) {
                case MotionEvent.ACTION_DOWN:
                    //isMove = false;
                    mTouchX = event.getRawX();
                    mTouchY = event.getRawY();
                    break;

                case MotionEvent.ACTION_UP:
                    //Log.i("musicInfo", "ACTION_UP! TouchY:" + mTouchY + " UpY: " + event.getRawY() + " Move: " + (mTouchY - event.getRawY()));
                    int dX = (int) (mTouchX - event.getRawX());
                    if (dX > 5) {
                        if (jArtists.length() > 1) {
                            imageLoader.stop();
                            try {
                                if (artistNum == 0) {
                                    artistNum = jArtists.length() - 1;
                                } else {
                                    artistNum--;
                                }

                                displayArtistInfo(jArtists.getJSONObject(artistNum));
                                imageLoader.resume();

                            } catch (JSONException e) {
                                e.printStackTrace();
                            }

                        }

                    } else if (dX < -5) {
                        if (jArtists.length() > 1) {
                            imageLoader.stop();
                            try {
                                if (artistNum == jArtists.length() - 1) {
                                    artistNum = 0;
                                } else {
                                    artistNum++;
                                }
                                displayArtistInfo(jArtists.getJSONObject(artistNum));
                                imageLoader.resume();
                            } catch (JSONException e) {
                                e.printStackTrace();
                            }

                        }

                    }

                    break;

                case MotionEvent.ACTION_MOVE:

                    break;
                }

                return true;
            }
        });
    }

    mGridView.setOnScrollListener(new AbsListView.OnScrollListener() {
        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {
            //Log.d("musicInfo", "SGV onScrollStateChanged:" + scrollState);
        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
            //Log.d("musicInfo", "SGV onScroll firstVisibleItem:" + firstVisibleItem + " visibleItemCount:" + visibleItemCount + " totalItemCount:" + totalItemCount);
            // our handling
            if (!mHasRequestedMore) {
                int lastInScreen = firstVisibleItem + visibleItemCount;
                if (lastInScreen >= totalItemCount) {
                    //Log.d("musicInfo", "SGV onScroll lastInScreen - so load more");
                    mHasRequestedMore = true;
                    onLoadMoreItems();
                }
            }
        }

        private void onLoadMoreItems() {
            if (jVideoArray == null)
                return;
            final ArrayList<JSONObject> sampleData = generateImageData(jVideoArray);
            for (JSONObject data : sampleData) {
                mAdapter.add(data);
            }
            // stash all the data in our backing store
            mData.addAll(sampleData);
            // notify the adapter that we can update now
            mAdapter.notifyDataSetChanged();
            mHasRequestedMore = false;
        }
    });

    mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Toast.makeText(getApplicationContext(), "Open the Video...", Toast.LENGTH_SHORT).show();
            StaggeredViewAdapter.ViewHolder vh = (StaggeredViewAdapter.ViewHolder) view.getTag();

            Intent intent = new Intent();
            intent.setAction(Intent.ACTION_VIEW);
            intent.addCategory(Intent.CATEGORY_BROWSABLE);
            intent.setData(Uri.parse((String) vh.url));
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intent);
            //finish();

        }

    });

    //int[] lArtistLinkPosition = new int[2];
    //int[] tArtistNamePosition = new int[2];

    //lArtistLink.getLocationOnScreen(lArtistLinkPosition);
    //tArtistName.getLocationOnScreen(tArtistNamePosition);

    //Log.d("musicInfo", "SGV transition = " + SGVtransition);
}

From source file:com.wiret.arbrowser.AbstractArchitectCamActivity.java

/** Called when the activity is first created. */
@SuppressLint("NewApi")
@Override//from   w w w .ja  v a2 s .  c  o  m
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    /* pressing volume up/down should cause music volume changes */
    this.setVolumeControlStream(AudioManager.STREAM_MUSIC);

    this.setTitle(this.getActivityTitle());

    /*  
     *   this enables remote debugging of a WebView on Android 4.4+ when debugging = true in AndroidManifest.xml
     *   If you get a compile time error here, ensure to have SDK 19+ used in your ADT/Eclipse.
     *   You may even delete this block in case you don't need remote debugging or don't have an Android 4.4+ device in place.
     *   Details: https://developers.google.com/chrome-developer-tools/docs/remote-debugging
     */
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        if (0 != (getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE)) {
            WebView.setWebContentsDebuggingEnabled(true);
        }
    }

    kmlFile = getIntent().getData();

    if (ContextCompat.checkSelfPermission(this,
            Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
        ActivityCompat.requestPermissions(this,
                new String[] { android.Manifest.permission.READ_EXTERNAL_STORAGE,
                        android.Manifest.permission.CAMERA, android.Manifest.permission.ACCESS_FINE_LOCATION },
                101);
    } else {
        try {
            this.setContentView(this.getContentViewId());
            initArView();
        } catch (Exception rex) {
            this.architectView = null;
            AbstractArchitectCamActivity.this.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(AbstractArchitectCamActivity.this, "AR not supported by this device.",
                            Toast.LENGTH_LONG).show();
                }
            });
            Log.e(this.getClass().getName(), "Exception in ArchitectView.onCreate()", rex);
            finish();
        }
    }

}

From source file:com.teleca.jamendo.activity.BrowsePlaylistActivity.java

/** Called when the activity is first created. */
@Override/*from w w w  .  j a  va2s  . c o m*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.browse_playlist);

    mPlaylistsListView = (ListView) findViewById(R.id.PlaylistsListView);
    mPlaylistsListView.setOnItemLongClickListener(mItemLongClick);
    mButton = (Button) findViewById(R.id.BrowseButton);
    mEditText = (EditText) findViewById(R.id.BrowseEditText);
    mViewFlipper = (ViewFlipper) findViewById(R.id.BrowsePlaylistViewFlipper);

    setupMode((Mode) getIntent().getSerializableExtra("mode"));

    mGestureOverlayView = (GestureOverlayView) findViewById(R.id.gestures);
    mGestureOverlayView
            .addOnGesturePerformedListener(JamendoApplication.getInstance().getPlayerGestureHandler());
}

From source file:com.android.settingslib.drawer.SettingsDrawerActivity.java

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    long startTime = System.currentTimeMillis();

    TypedArray theme = getTheme().obtainStyledAttributes(android.R.styleable.Theme);
    if (!theme.getBoolean(android.R.styleable.Theme_windowNoTitle, false)) {
        getWindow().addFlags(LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        getWindow().addFlags(LayoutParams.FLAG_TRANSLUCENT_STATUS);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
    }/*from  w  w  w. j  a  va2 s .  c o m*/
    super.setContentView(R.layout.settings_with_drawer);
    mContentHeaderContainer = (FrameLayout) findViewById(R.id.content_header_container);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    if (mDrawerLayout == null) {
        return;
    }
    Toolbar toolbar = (Toolbar) findViewById(R.id.action_bar);
    if (theme.getBoolean(android.R.styleable.Theme_windowNoTitle, false)) {
        toolbar.setVisibility(View.GONE);
        mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
        mDrawerLayout = null;
        return;
    }
    getDashboardCategories();
    setActionBar(toolbar);
    mDrawerAdapter = new SettingsDrawerAdapter(this);
    ListView listView = (ListView) findViewById(R.id.left_drawer);
    listView.setAdapter(mDrawerAdapter);
    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        public void onItemClick(android.widget.AdapterView<?> parent, View view, int position, long id) {
            onTileClicked(mDrawerAdapter.getTile(position));
        }
    });

    mUserManager = UserManager.get(this);
    if (DEBUG_TIMING)
        Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime) + " ms");
}

From source file:com.ameron32.apps.tapnotes._unused.original.LoginActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);

    super.onCreate(savedInstanceState);

    // Combine options from incoming intent and the activity metadata
    configOptions = getMergedOptions();//from www.  ja  va  2s .c  o  m

    // Show the login form
    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction()
                .add(fragmentContainer, LoginFragment.newInstance(configOptions)).commit();
    }
}

From source file:com.google.zxing.demo.CaptureActivity.java

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    Window window = getWindow();/*from  w  w w.  jav a  2  s.c  o  m*/
    window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    setContentView(R.layout.activity_zxing_capture);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setStatusBarTintColor(getResources().getColor(R.color.color_333333));
    }
    zxingCaptureRlBack = (RelativeLayout) findViewById(R.id.zxing_capture_rl_back);
    zxingCaptureRlBack.setOnClickListener(this);
    zxingCaptureRlBack.setBackgroundResource(R.drawable.bg_common_btn);

    hasSurface = false;
    inactivityTimer = new InactivityTimer(this);
    beepManager = new BeepManager(this);

}

From source file:com.example.paul.cs407project.ParseLoginActivity.java

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

    this.requestWindowFeature(Window.FEATURE_NO_TITLE);

    // Combine options from incoming intent and the activity metadata
    configOptions = getMergedOptions();// ww w  .  ja  v  a2  s.  c  o m

    // Show the login form
    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction()
                .add(fragmentContainer, ParseLoginFragment.newInstance(configOptions)).commit();
    }
}

From source file:com.example.voicecast_gglasssample.VoiceCastMainActivity.java

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

    featureIdSave = -1;/*from  w  w w. j a v a  2s .c o m*/
    foundDevice = false;

    // Card
    mainCard = new Card(this);
    mainCard.setText("This is a card");

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().requestFeature(WindowUtils.FEATURE_VOICE_COMMANDS);
    featureIdSave = WindowUtils.FEATURE_VOICE_COMMANDS;

    mainCardView = mainCard.getView();
    mainCardView.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            openOptionsMenu();
        }
    });
    mainCardView.setFocusable(true);
    mainCardView.setFocusableInTouchMode(true);
    setContentView(mainCardView);

    // Device selection card list
    mRouteInfos = new ArrayList<MediaRouter.RouteInfo>();
    dCards = new ArrayList<Card>();
    mCardScrollView = new CardScrollView(this);
    mAdapter = new DeviceCardScrollAdapter();
    mAdapter.setCardList(dCards);
    mCardScrollView.setAdapter(mAdapter);
    mCardScrollView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, final View view, int position, long id) {
            Log.d(TAG, "onItemClick: position=" + position);

            MediaRouter.RouteInfo info = mRouteInfos.get(position);
            mMediaRouter.selectRoute(info);

            mainCard.setText("Connected");
            mainCardView = mainCard.getView();
            mainCardView.setOnClickListener(new OnClickListener() {
                @Override
                public void onClick(View arg0) {
                    openOptionsMenu();
                }
            });
            mainCardView.setFocusable(true);
            mainCardView.setFocusableInTouchMode(true);
            setContentView(mainCardView);
        }

    });

    // Configure Cast device discovery
    mMediaRouter = MediaRouter.getInstance(getApplicationContext());
    mMediaRouteSelector = new MediaRouteSelector.Builder().addControlCategory(
            CastMediaControlIntent.categoryForCast(getResources().getString(R.string.app_id))).build();
    mMediaRouterCallback = new MyMediaRouterCallback();
}