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:no.ntnu.idi.socialhitchhiking.utility.ShareOnFacebook.java

@SuppressWarnings("deprecation")
@Override//w  ww . ja v a 2  s  .  c  om
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    currentRoute = getApp().getSelectedRoute();
    facebook = new Facebook(APP_ID);
    restoreCredentials(facebook);

    requestWindowFeature(Window.FEATURE_NO_TITLE);

    setContentView(R.layout.facebook_dialog);

    //Intitialize TripOption string values
    String formatedDate = formatDate(getApp().getSelectedJourney().getStart());
    String formatedTime = formatTime(getApp().getSelectedJourney().getStart());

    date = "Date: " + formatedDate;
    time = "Start time: " + formatedTime;
    seats = "Seats available: " + getApp().getSelectedJourney().getTripPreferences().getSeatsAvailable();
    //      String extras = "Extras: "+ getApp().getSelectedJourney().getTripPreferences().toString();
    BitSet sExtras = getApp().getSelectedJourney().getTripPreferences().getExtras();
    extras = "Preferences: ";
    String[] items = { "Music", "Animals", "Breaks", "Talking", "Smoking" };
    for (int i = 0; i < sExtras.length(); i++) {
        if (sExtras.get(i)) {
            if (i == sExtras.length() - 1)
                extras = extras + items[i] + ".";
            else {
                if (i == sExtras.length() - 2)
                    extras = extras + items[i] + " and ";
                else
                    extras = extras + items[i] + ", ";
            }
        }
    }
    String facebookMessage = "";
    isDriver = getIntent().getExtras().getBoolean("isDriver");
    if (isDriver) {
        facebookMessage = "I have created a new drive on FreeRider\n" + date + "\n" + time + "\n" + seats + "\n"
                + extras;
    } else {
        facebookMessage = "I am hitchhiking on a new ride on FreeRider\n" + date + "\n" + time + "\n" + seats
                + "\n" + extras;
        ;
    }
    messageToPost = facebookMessage;
}

From source file:com.cardio3g.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    Fabric.with(this, new Crashlytics());
    setContentView(R.layout.activity_main);
    mDownloadViewGroup = (RelativeLayout) findViewById(R.id.downloadViewGroup);
    mDownloadProgressBar = (ProgressBar) findViewById(R.id.downloadProgressBar);
    mProgressPercentTextView = (TextView) findViewById(R.id.downloadProgressPercentTextView);
    mainLayout = (RelativeLayout) findViewById(R.id.mainLayout);
    mDownloaderClientStub = DownloaderClientMarshaller.CreateStub(this, DownloaderService.class);
    if (!expansionFilesDelivered()) {

        try {/*from  w w w .  ja  va2 s  .c  om*/
            Intent launchIntent = MainActivity.this.getIntent();
            Intent intentToLaunchThisActivityFromNotification = new Intent(MainActivity.this,
                    MainActivity.this.getClass());
            intentToLaunchThisActivityFromNotification
                    .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
            intentToLaunchThisActivityFromNotification.setAction(launchIntent.getAction());

            if (launchIntent.getCategories() != null) {
                for (String category : launchIntent.getCategories()) {
                    intentToLaunchThisActivityFromNotification.addCategory(category);
                }
            }

            // Build PendingIntent used to open this activity from
            // Notification
            PendingIntent pendingIntent = PendingIntent.getActivity(MainActivity.this, 0,
                    intentToLaunchThisActivityFromNotification, PendingIntent.FLAG_UPDATE_CURRENT);
            // Request to start the download
            int startResult = DownloaderClientMarshaller.startDownloadServiceIfRequired(this, pendingIntent,
                    DownloaderService.class);

            if (startResult != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) {
                // The DownloaderService has started downloading the files, show progress
                initializeDownloadUI();
                return;
            } // otherwise, download not needed so we fall through to the app
        } catch (PackageManager.NameNotFoundException e) {
            Log.e("EXPANSION ERROR", "Cannot find package!", e);
        }
    } else {
        validateXAPKZipFiles();
    }

    btnBuiltIn = (Button) findViewById(R.id.button_builtin);
    btnMuscleIsolation = (Button) findViewById(R.id.button_muscle);
    btnCustomProgram = (Button) findViewById(R.id.button_custom);
    btnSportsTraining = (Button) findViewById(R.id.button_sports);
    btnhealthyLiving = (Button) findViewById(R.id.button_healthy);
    btnPersonalTrainer = (Button) findViewById(R.id.button_personal);
    btnVideos = (Button) findViewById(R.id.button_exercise_videos);
    btnCardio = (Button) findViewById(R.id.button_visit);
    btnImages = (Button) findViewById(R.id.button_exercise_photos);
    frameLayout = (FrameLayout) findViewById(R.id.frame);
    videoView = (VideoView) findViewById(R.id.video_view);
    btnBuiltIn.setOnClickListener(this);
    btnMuscleIsolation.setOnClickListener(this);
    btnCustomProgram.setOnClickListener(this);
    btnSportsTraining.setOnClickListener(this);
    btnhealthyLiving.setOnClickListener(this);
    btnPersonalTrainer.setOnClickListener(this);
    btnVideos.setOnClickListener(this);
    btnCardio.setOnClickListener(this);
    btnImages.setOnClickListener(this);

    mediaController = new MediaController(MainActivity.this);
    checkPermission();
}

From source file:nf.frex.android.FrexActivity.java

/**
 * Called when the activity is first created.
 *//*w  ww .  j a va 2  s  .c  o  m*/
@Override
public void onCreate(Bundle savedInstanceState) {
    //Log.d(TAG, "onCreate(savedInstanceState=" + savedInstanceState + ")");
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_ACTION_BAR);
    requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
    requestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY);

    if (PRE_SDK14) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        // Fix: Frex to stop working on screen orientation changes (Android 2.3.x only)
        if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        } else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        }
    } else {
        getActionBar().setBackgroundDrawable(new PaintDrawable(Color.argb(128, 0, 0, 0)));
    }

    view = new FractalView(this);
    setContentView(view);

    if (!tryReadingFrexDocIntent(getIntent())) {
        if (savedInstanceState != null) {
            view.restoreInstanceState(new BundlePropertySet(savedInstanceState));
        } else {
            PropertySet propertySet = (PropertySet) getLastNonConfigurationInstance();
            if (propertySet != null) {
                view.restoreInstanceState(propertySet);
            }
        }
    }
}

From source file:com.commonsdroid.fragmentdialog.ViewDialogFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Bundle bundle = getArguments();/*  w w w . j  av  a2 s .  co m*/
    //      LayoutParams params = getDialog().getWindow().getAttributes(); 
    //       params.height = bundle.getInt(HEIGHT); //fixed height
    //       params.width = bundle.getInt(WIDTH); //fixed width
    //       params.alpha = 1.0f;
    //       params.dimAmount = 0.5f;
    if (bundle.getInt(WIDTH, 0) != 0 && bundle.getInt(HEIGHT, 0) != 0)
        getDialog().getWindow().setLayout(bundle.getInt(WIDTH), bundle.getInt(HEIGHT));
    else {
        Log.d("CHECK HEIGHT", "0 0");
    }
    //       getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params); 

    if (!bundle.getBoolean(TITLE_BAR_VISIBLE, true))
        getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
    else if (bundle.getString(TITLE) != null)
        getDialog().setTitle(bundle.getString(TITLE));
    if (bundle.getInt(ANIMATION) != 0)
        getDialog().getWindow().getAttributes().windowAnimations = bundle.getInt(ANIMATION);
    if (bundle.getInt(STYLE, -1) != -1 && bundle.getInt(THEME, -1) != -1)
        setStyle(bundle.getInt(STYLE), bundle.getInt(THEME));
    else {
        Log.d("CHECK THEME", "0 0");
    }

    setCancelable(bundle.getBoolean(CANCELABLE));

    if (bundle.getInt(MAP) > 0) {
        FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
        transaction.add(bundle.getInt(MAP), fragment).commit();
    }

    int v = bundle.getInt(VIEW);
    View view = inflater.inflate(v, null);
    identifier = bundle.getInt(IDENTIFIER);
    interfaceDialog.getView(identifier, view, getDialog());

    return view;
}

From source file:com.chute.android.photopickerplus.ui.activity.AssetActivity.java

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

    requestWindowFeature(Window.FEATURE_NO_TITLE);

    setContentView(R.layout.gc_activity_assets);

    retrieveSavedValuesFromBundle(savedInstanceState);

    wrapper = new PhotosIntentWrapper(getIntent());
    account = wrapper.getAccount();//from ww w  . j  av  a 2s . c o  m
    filterType = wrapper.getFilterType();

    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    if (savedInstanceState == null) {
        fragmentRoot = FragmentRoot.newInstance(account, filterType, selectedAccountsPositions,
                selectedImagesPositions, selectedVideosPositions);
        ft.add(R.id.gcFragments, fragmentRoot, Constants.TAG_FRAGMENT_FOLDER).commit();
    }

}

From source file:com.infthink.demo.webrtc.MainActivity.java

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

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);

    setContentView(R.layout.activity_fullscreen);

    // init flint related
    String APPLICATION_ID = "~flint_android_webrtc_demo";
    Flint.FlintApi.setApplicationId(APPLICATION_ID);

    mWebrtcChannel = new MyWebrtcChannel();

    mMediaRouter = MediaRouter.getInstance(getApplicationContext());
    mMediaRouteSelector = new MediaRouteSelector.Builder()
            .addControlCategory(FlintMediaControlIntent.categoryForFlint(APPLICATION_ID)).build();

    mMediaRouterCallback = new MediaRouterCallback();
    mFlingListener = new FlingListener();
    mConnectionCallbacks = new ConnectionCallbacks();

    mIceConnected = false;/*from   ww w  . j  a v a2  s.c  o  m*/

    // init views
    mRootView = findViewById(android.R.id.content);
    mEncoderStatView = (TextView) findViewById(R.id.encoder_stat);
    mMenuBar = findViewById(R.id.menubar_fragment);
    mRoomName = (TextView) findViewById(R.id.room_name);
    mVideoView = (GLSurfaceView) findViewById(R.id.glview);

    mMediaRouteButton = (MediaRouteButton) mMenuBar.findViewById(R.id.media_route_button);
    mMediaRouteButton.setRouteSelector(mMediaRouteSelector);

    VideoRendererGui.setView(mVideoView);

    mScalingType = ScalingType.SCALE_ASPECT_FILL;
    mRemoteRender = VideoRendererGui.create(0, 0, 100, 100, mScalingType, false);
    mLocalRender = VideoRendererGui.create(0, 0, 100, 100, mScalingType, true);

    mVideoView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            int visibility = mMenuBar.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE;
            mEncoderStatView.setVisibility(visibility);
            mMenuBar.setVisibility(visibility);
            mRoomName.setVisibility(visibility);
            if (visibility == View.VISIBLE) {
                mEncoderStatView.bringToFront();
                mMenuBar.bringToFront();
                mRoomName.bringToFront();
                mRootView.invalidate();
            }
        }
    });

    ((ImageButton) findViewById(R.id.button_disconnect)).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            logAndToast("Disconnecting call.");
            disconnect();
        }
    });

    ((ImageButton) findViewById(R.id.button_switch_camera)).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (mPeerConn != null) {
                mPeerConn.switchCamera();
            }
        }
    });

    ((ImageButton) findViewById(R.id.button_toggle_debug)).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            int visibility = mHudView.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE;
            mHudView.setVisibility(visibility);

            // use this to send view switch
            if (mApiClient != null && mApiClient.isConnected()) {
                mWebrtcChannel.sendSwitchView(mApiClient);
            }
        }
    });

    mVideoScalingButton = (ImageButton) findViewById(R.id.button_scaling_mode);
    mVideoScalingButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if (mScalingType == ScalingType.SCALE_ASPECT_FILL) {
                mVideoScalingButton.setBackgroundResource(R.drawable.ic_action_full_screen);
                mScalingType = ScalingType.SCALE_ASPECT_FIT;
            } else {
                mVideoScalingButton.setBackgroundResource(R.drawable.ic_action_return_from_full_screen);
                mScalingType = ScalingType.SCALE_ASPECT_FILL;
            }
            updateVideoView();
        }
    });

    mHudView = new TextView(this);
    mHudView.setTextColor(Color.BLACK);
    mHudView.setBackgroundColor(Color.WHITE);
    mHudView.setAlpha(0.4f);
    mHudView.setTextSize(TypedValue.COMPLEX_UNIT_PT, 5);
    mHudView.setVisibility(View.INVISIBLE);
    addContentView(mHudView, mHudLayout);

    // Create and audio manager that will take care of audio routing,
    // audio modes, audio device enumeration etc.
    mAudioManager = AppRTCAudioManager.create(this);

    // ready to init webrtc params
    mWebrtcHelper = new WebRtcHelper(this);
    mWebrtcHelper.initParams();
}

From source file:com.njlabs.amrita.aid.gpms.ui.GpmsActivity.java

@Override
public void init(Bundle savedInstanceState) {
    setupLayout(R.layout.activity_gpms_login, Color.parseColor("#009688"));
    rollNoEditText = (EditText) findViewById(R.id.roll_no);
    passwordEditText = (EditText) findViewById(R.id.pwd);

    AlertDialog.Builder builder = new AlertDialog.Builder(baseContext);
    builder.setMessage("Amrita University does not provide an API for accessing GPMS data. "
            + "So, if any changes are made to the GPMS Website, please be patient while I try to catch up.")
            .setCancelable(true).setIcon(R.drawable.ic_action_info_small)
            .setPositiveButton("Got it !", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();/* w w  w  .  j a  v a 2s  . com*/
                    hideSoftKeyboard();
                    showConnectToAmritaAlert();
                }
            });
    AlertDialog alert = builder.create();
    alert.requestWindowFeature(Window.FEATURE_NO_TITLE);
    alert.show();

    dialog = new ProgressDialog(baseContext);
    dialog.setIndeterminate(true);
    dialog.setCancelable(false);
    dialog.setInverseBackgroundForced(false);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setMessage("Authenticating your credentials ... ");
    preferences = getSharedPreferences("gpms_prefs", Context.MODE_PRIVATE);
    String rollNo = preferences.getString("roll_no", "");
    String encodedPassword = preferences.getString("password", "");
    if (!rollNo.equals("")) {
        rollNoEditText.setText(rollNo);
        studentRollNo = rollNo;
        hideSoftKeyboard();
    } else {
        SharedPreferences aumsPrefs = getSharedPreferences("aums_prefs", Context.MODE_PRIVATE);
        String aumsRollNo = aumsPrefs.getString("RollNo", "");
        if (!aumsRollNo.equals("")) {
            rollNoEditText.setText(aumsRollNo);
            studentRollNo = aumsRollNo;
            hideSoftKeyboard();
        }
    }

    if (!encodedPassword.equals("")) {
        passwordEditText.setText(Security.decrypt(encodedPassword, MainApplication.key));
        hideSoftKeyboard();
    }
}

From source file:com.agna.setmaster.ui.screen.profile.setting.change.ChangeVolumeSettingDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = new ChangeSettingDialog(getActivity(), getTheme());
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    return dialog;
}

From source file:com.android.mms.quickmessage.QuickMessage.java

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

    // Initialise the message list and other variables
    mContext = this;
    mMessageList = new ArrayList<QuickMessageContent>();
    mDefaultContactImage = getResources().getDrawable(R.drawable.ic_contact_picture);
    mCloseClosesAll = MessagingPreferenceActivity.getQmCloseAllEnabled(mContext);
    mWakeAndUnlock = MessagingPreferenceActivity.getQmLockscreenEnabled(mContext);

    // Set the window features and layout
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.dialog_quickmessage);

    // Load the views and Parse the intent to show the QuickMessage
    setupViews();//from w ww  . j av a2 s. co m
    parseIntent(getIntent(), false);
}