Example usage for android.view Window FEATURE_CUSTOM_TITLE

List of usage examples for android.view Window FEATURE_CUSTOM_TITLE

Introduction

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

Prototype

int FEATURE_CUSTOM_TITLE

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

Click Source Link

Document

Flag for custom title.

Usage

From source file:com.androidaq.AndroiDAQTCPMain.java

@Override
public void onNewIntent(Intent intent) {
    if (D)//  w w  w.j a va  2 s  .  c o m
        Log.e(TAG, "+++ NEW INTENT +++");

    // Set up the window layout
    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    setContentView(R.layout.main);
    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);

    // Set up the custom title
    mTitle = (TextView) findViewById(R.id.title_left_text);
    mTitle.setText(R.string.right_title);
    mTitle = (TextView) findViewById(R.id.title_right_text);

    Intent intent1 = getIntent();
    TCPAddress = intent1.getStringExtra("TCPAddress");

    AndroiDAQTCPAdapter adapter = new AndroiDAQTCPAdapter(this);
    pager = (ViewPager) findViewById(R.id.viewpager);
    pager.setOffscreenPageLimit(6);
    indicator = (TitlePageIndicator) findViewById(R.id.indicator);
    pager.setAdapter(adapter);
    indicator.setViewPager(pager);
    mWaveform = (WaveFormView) findViewById(R.id.WaveformArea);
    //indicator.setOnPageChangeListener(this);
}

From source file:com.androidaq.AndroiDAQMain.java

@Override
public void onNewIntent(Intent intent) {
    if (D)/*www  . j a  v a 2 s  .co  m*/
        Log.e(TAG, "+++ NEW INTENT +++");

    // Set up the window layout
    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    setContentView(R.layout.main);
    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);

    // Set up the custom title
    mTitle = (TextView) findViewById(R.id.title_left_text);
    mTitle.setText(R.string.right_title);
    mTitle = (TextView) findViewById(R.id.title_right_text);

    AndroiDAQAdapter adapter = new AndroiDAQAdapter(this);
    pager = (ViewPager) findViewById(R.id.viewpager);
    pager.setOffscreenPageLimit(6);
    indicator = (TitlePageIndicator) findViewById(R.id.indicator);
    pager.setAdapter(adapter);
    indicator.setViewPager(pager);
    mWaveform = (WaveFormView) findViewById(R.id.WaveformArea);
    //indicator.setOnPageChangeListener(this);
    // Get local Bluetooth adapter
    mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
    // If the adapter is null, then Bluetooth is not supported
    if (mBluetoothAdapter == null) {
        Toast.makeText(this, "Bluetooth is not available", Toast.LENGTH_LONG).show();
        finish();
        return;
    }

}

From source file:edu.pitt.gis.uniapp.UniApp.java

/**
 * Called when the activity is first created.
 *
 * @param savedInstanceState/*from  w  ww .ja v a 2  s .c om*/
 */
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) {
    //preferences = new PreferenceSet();

    LOG.d(TAG, "UniApp.onCreate()");
    super.onCreate(savedInstanceState);

    // Get some configs: fullscreen,
    if (this.getBooleanProperty("setFullscreen", false)) {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    }

    // Custom title for UniApp
    this.customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);

    setContentView(R.layout.uni_app);
    this.root = (LinearLayout) findViewById(R.id.uniappLayout);

    // Setup the hardware volume controls to handle volume control
    setVolumeControlStream(AudioManager.STREAM_MUSIC);

    this.loadUrl(HOME_URL);
}

From source file:com.nonstop.android.SoC.BluetoothChat.BluetoothChat.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (D)/*from w ww  .  j  a va 2 s .  c o m*/
        Log.e(TAG, "+++ ON CREATE +++");

    // Set up the window layout
    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    setContentView(R.layout.bluetooth_chat);
    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);

    // Set up the custom title
    mTitle = (TextView) findViewById(R.id.title_left_text);
    mTitle.setText(R.string.app_name);
    mTitle = (TextView) findViewById(R.id.title_right_text);

    // Get local Bluetooth adapter
    mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

    // If the adapter is null, then Bluetooth is not supported
    if (mBluetoothAdapter == null) {
        Toast.makeText(this, "Bluetooth is not available", Toast.LENGTH_LONG).show();
        finish();
        return;
    }

    if (APP_ID == null) {
        com.facebook.android.Util.showAlert(this, "Warning",
                "Facebook Applicaton ID must be " + "specified before running this example: see FbAPIs.java");
        return;
    }

    // setContentView(R.layout.main);
    mHandler_facebook = new Handler();

    mText = (TextView) this.findViewById(R.id.txt);
    mUserPic = (ImageView) this.findViewById(R.id.user_pic);

    // Create the Facebook Object using the app id.
    Utility.mFacebook = new Facebook(APP_ID);
    // Instantiate the asynrunner object for asynchronous api calls.
    Utility.mAsyncRunner = new AsyncFacebookRunner(Utility.mFacebook);

    mLoginButton = (LoginButton) findViewById(R.id.login);

    // restore session if one exists
    SessionStore.restore(Utility.mFacebook, this);
    SessionEvents.addAuthListener(new FbAPIsAuthListener());
    SessionEvents.addLogoutListener(new FbAPIsLogoutListener());

    /*
     * Source Tag: login_tag
     */
    mLoginButton.init(this, AUTHORIZE_ACTIVITY_RESULT_CODE, Utility.mFacebook, permissions);

    if (Utility.mFacebook.isSessionValid()) {
        requestUserData();
    }

}

From source file:com.android.quake.llvm.DownloaderActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = getIntent();//from  ww w.  j  av  a2 s  .c om
    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    setContentView(R.layout.downloader);
    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.downloader_title);
    ((TextView) findViewById(R.id.customText)).setText(intent.getStringExtra(EXTRA_CUSTOM_TEXT));
    mProgress = (TextView) findViewById(R.id.progress);
    mTimeRemaining = (TextView) findViewById(R.id.time_remaining);
    Button button = (Button) findViewById(R.id.cancel);
    button.setOnClickListener(new Button.OnClickListener() {
        public void onClick(View v) {
            if (mDownloadThread != null) {
                mSuppressErrorMessages = true;
                mDownloadThread.interrupt();
            }
        }
    });
    startDownloadThread();
}

From source file:gr.scify.newsum.ui.SearchViewActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if ((getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_NORMAL
            & (getResources().getConfiguration().screenLayout
                    & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_SMALL) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

    }//from w ww .  ja v a 2 s .c  om
    SharedPreferences usertheme = getSharedPreferences("theme", 0);
    int newTheme = usertheme.getInt("theme", 2);
    Utils.onActivityCreateSetTheme(this, newTheme);

    SharedPreferences userlang = getSharedPreferences("lang", 0);
    String newlang = userlang.getString("lang", Locale.getDefault().getLanguage());
    Setlanguage.updateLanguage(getApplicationContext(), newlang);

    GestureOverlayView gestureOverlayView = new GestureOverlayView(this);
    View inflate = getLayoutInflater().inflate(R.layout.view, null);
    gestureOverlayView.addView(inflate);
    gestureOverlayView.addOnGesturePerformedListener(this);
    gestureOverlayView.setGestureColor(Color.TRANSPARENT);
    gestureOverlayView.setUncertainGestureColor(Color.TRANSPARENT);
    gestureLib = GestureLibraries.fromRawResource(this, R.raw.gestures);
    if (!gestureLib.load()) {
        finish();
    }
    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    setContentView(gestureOverlayView);
    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);

    ImageView title_image = (ImageView) findViewById(R.id.title_image);
    title_image.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent browse = new Intent(Intent.ACTION_VIEW, Uri.parse(getResources().getString(R.string.scify)));
            startActivity(browse);
        }

    });

    // setContentView(R.layout.view);
    // TODO: Add Loading dialog

    SharedPreferences setvmassage = getSharedPreferences("dialog", 0);
    boolean dialogShown = setvmassage.getBoolean("dialogShown", false);

    if (!dialogShown) {
        // prepare the alert box
        AlertDialog.Builder alertbox = new AlertDialog.Builder(this);
        alertbox.setMessage(R.string.view_massage);
        alertbox.setNeutralButton(R.string.ok, new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface arg0, int arg1) {

            }
        });
        alertbox.setCancelable(false);
        alertbox.show();

        SharedPreferences.Editor editor = setvmassage.edit();
        editor.putBoolean("dialogShown", true);
        editor.commit();
    }

    // Init waiting dialog
    showWaitingDialog();

    initLayoutAndControls();

}

From source file:com.radicaldynamic.groupinform.activities.LauncherActivity.java

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

    // If SD card error, quit
    if (!FileUtilsExtended.storageReady())
        showDialog(DIALOG_EXTERNAL_STORAGE_UNAVAILABLE);

    Intent intent = getIntent();/*from  w w  w.  j a  va2  s.  c o m*/

    if (intent == null) {
    } else {
        if (intent.getBooleanExtra(KEY_REINIT_IOSERVICE, false)) {
            if (Collect.getInstance().getIoService() instanceof InformOnlineService)
                Collect.getInstance().getIoService().reinitializeService();
        }
    }

    displaySplash();

    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    setContentView(R.layout.launcher);

    mProgressLoading = (TextView) findViewById(R.id.progressLoading);

    startService(new Intent(this, InformOnlineService.class));
    startService(new Intent(this, DatabaseService.class));

    new InitializeApplicationTask().execute(getApplicationContext());
}

From source file:com.leo.runningman.ui.ImageGridFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Window window = getActivity().getWindow();
    window.setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.layout_title);

    final View v = inflater.inflate(R.layout.image_grid_fragment, container, false);

    TextView txt_title = (TextView) this.getActivity().findViewById(R.id.txt_title);
    txt_title.setText(getActivity().getResources().getString(R.string.app_name));
    Button btn_delete = (Button) this.getActivity().findViewById(R.id.btn_delete);
    TextView txt_delete_confirm = (TextView) this.getActivity().findViewById(R.id.txt_delete_confirm);
    btn_delete.setVisibility(View.GONE);
    txt_delete_confirm.setVisibility(View.GONE);

    layout_bottom = (RelativeLayout) v.findViewById(R.id.layout_bottom);
    autoHideview(4000);//from  w  w  w  .j ava  2 s . c  o  m

    final GridView mGridView = (GridView) v.findViewById(R.id.gridView);
    mGridView.setAdapter(mAdapter);
    mGridView.setOnItemClickListener(this);

    // This listener is used to get the final width of the GridView and then calculate the
    // number of columns and the width of each column. The width of each column is variable
    // as the GridView has stretchMode=columnWidth. The column width is used to set the height
    // of each view so we get nice square thumbnails.
    mGridView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        @Override
        public void onGlobalLayout() {
            if (mAdapter.getNumColumns() == 0) {
                final int numColumns = (int) Math
                        .floor(mGridView.getWidth() / (mImageThumbSize + mImageThumbSpacing));
                if (numColumns > 0) {
                    final int columnWidth = (mGridView.getWidth() / numColumns) - mImageThumbSpacing;
                    mAdapter.setNumColumns(numColumns);
                    mAdapter.setItemHeight(columnWidth);
                    if (BuildConfig.DEBUG) {
                        Log.d(TAG, "onCreateView - numColumns set to " + numColumns);
                    }
                }
            }
        }
    });
    mGridView.setOnScrollListener(new OnScrollListener() {

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {
            switch (scrollState) {
            case OnScrollListener.SCROLL_STATE_IDLE:
                if (loadMore) {
                    new HttpGetTask(1000L).execute();
                }
                break;
            case OnScrollListener.SCROLL_STATE_FLING:
                break;
            case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:
                break;
            }
            hideBottomLayout();
            cancelAutoHideview();
        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
            Log.i(TAG, "firstVisibleItem:--->" + firstVisibleItem + "visibleItemCount:----->" + visibleItemCount
                    + "totalItemCount:" + totalItemCount);
            loadMore = firstVisibleItem + visibleItemCount >= totalItemCount;
            start = totalItemCount;
            autoShowview(2000);
        }
    });

    adview_first = (AdView) v.findViewById(R.id.adview_first); //TODO
    return v;
}

From source file:gr.scify.newsum.ui.ViewActivity.java

protected void initGestures() {
    GestureOverlayView gestureOverlayView = new GestureOverlayView(this);
    View inflate = getLayoutInflater().inflate(R.layout.view, null);
    gestureOverlayView.addView(inflate);
    gestureOverlayView.addOnGesturePerformedListener(this);
    gestureOverlayView.setGestureColor(Color.TRANSPARENT);
    gestureOverlayView.setUncertainGestureColor(Color.TRANSPARENT);
    gestureLib = GestureLibraries.fromRawResource(this, R.raw.gestures);
    if (!gestureLib.load()) {
        finish();/*from  w w  w. j  a  va2s .co m*/
    }
    setContentView(gestureOverlayView);
    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);

    ImageView title_image = (ImageView) findViewById(R.id.title_image);
    title_image.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent browse = new Intent(Intent.ACTION_VIEW, Uri.parse(getResources().getString(R.string.scify)));
            startActivity(browse);
        }

    });

    // Allow links to be followed into browser
    final TextView tx = (TextView) findViewById(R.id.textView1);
    tx.setMovementMethod(LinkMovementMethod.getInstance());
}

From source file:edu.pitt.gis.uniapp.UniApp.java

/**
 * Create Custom title bar//from   w  ww . j  a v a 2  s  . c o  m
 * @return
 */
protected void createCustomTitleBar() {
    final UniApp me = this;

    if (this.customTitleSupported) {
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar);

        // Go to home
        final ImageButton homeBtn = (ImageButton) findViewById(R.id.appHomeBtn);
        homeBtn.setOnClickListener(new ImageButton.OnClickListener() {
            public void onClick(View v) {
                me.loadUrl(HOME_URL);
            }
        });

        // Input address
        final ImageButton urlBtn = (ImageButton) findViewById(R.id.appUrlBtn);
        urlBtn.setOnClickListener(new ImageButton.OnClickListener() {
            public void onClick(View v) {
                // Open input address dialog
                // Set an EditText view to get user input 
                final EditText input = new EditText(me);

                new AlertDialog.Builder(me).setTitle("Input URL").setMessage("Input URL to Load").setView(input)
                        .setPositiveButton("Ok", new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int whichButton) {
                                Editable value = input.getText();
                                me.loadUrl(value.toString());
                            }
                        }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int whichButton) {
                                // Do nothing.
                            }
                        }).show();
            }
        });

        final ImageButton aboutBtn = (ImageButton) findViewById(R.id.aboutBtn);
        aboutBtn.setOnClickListener(new ImageButton.OnClickListener() {
            public void onClick(View v) {
                about.setTitle("About this app");
                about.show();
            }
        });
    }
}