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:com.frostwire.android.gui.views.AbstractActivity.java

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

    if (!title) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
    }/*from   w  w w  . j  a  va  2s  .  co  m*/

    if (layoutResId != 0) {
        setContentView(layoutResId);
        initComponents();
    }
}

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

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

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

    setContentView(R.layout.image_viewer);
    mCorralClient = CorralClient.getInstance(this);
    im = (ImageView) findViewById(R.id.image);
    im.setScaleType(ImageView.ScaleType.FIT_CENTER);
    mIntent = getIntent();//from w ww .j  ava 2  s  .  c o  m
}

From source file:cn.org.eshow.framwork.activity.AbActivity.java

/**
 * ??.//from ww  w. ja va 2s  . c om
 *
 * @param savedInstanceState the saved instance state
 * @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle)
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    mInflater = LayoutInflater.from(this);

    //?
    mAbTitleBar = new AbTitleBar(this);

    //
    ab_base = new RelativeLayout(this);
    ab_base.setBackgroundColor(Color.rgb(255, 255, 255));

    //
    contentLayout = new RelativeLayout(this);
    contentLayout.setPadding(0, 0, 0, 0);

    //?
    mAbBottomBar = new AbBottomBar(this);

    //View
    ab_base.addView(mAbTitleBar,
            new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));

    mAbTitleBar.setVisibility(View.GONE);

    RelativeLayout.LayoutParams layoutParamsBottomBar = new RelativeLayout.LayoutParams(
            ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    layoutParamsBottomBar.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
    ab_base.addView(mAbBottomBar, layoutParamsBottomBar);

    RelativeLayout.LayoutParams layoutParamsContent = new RelativeLayout.LayoutParams(
            ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    layoutParamsContent.addRule(RelativeLayout.BELOW, mAbTitleBar.getId());
    layoutParamsContent.addRule(RelativeLayout.ABOVE, mAbBottomBar.getId());
    ab_base.addView(contentLayout, layoutParamsContent);

    //Application?
    abApplication = getApplication();

    //ContentView
    setContentView(ab_base,
            new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));

    AbActivityManager.getInstance().addActivity(this);
}

From source file:com.remdo.app.WebViewActivity.java

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_web_view);

    // Get the uri from the intent
    Intent intent = getIntent();//from  www .j  av a 2s.co m
    String uriToDisplay = intent.getStringExtra("DEVICE_URL");
    String usr = intent.getStringExtra("DEVICE_USER");
    String pwd = intent.getStringExtra("DEVICE_PASSWORD");
    Integer odTypeId = intent.getIntExtra("DEVICE_ODTYPEID", -1);

    if (odTypeId == 1)//ODNetWork    
    {
        if (!uriToDisplay.contains("cgi-bin/od.cgi")) {
            uriToDisplay = uriToDisplay.concat("/cgi-bin/od.cgi");
        }

        //initialize WebView
        webView = (WebView) findViewById(R.id.webView1);
        //we should define a webview client to get user navigation inside our webview otherwise 
        //defaul behaviour will open a webbrowser on first click
        webView.setWebViewClient(new WebViewClient());

        try {

            byte[] post = EncodingUtils.getBytes("USERNAME=" + usr + "&PASSWORD=" + pwd, "BASE64");
            webView.postUrl(uriToDisplay, post);

        } catch (Exception e) {
            String message = e.getMessage();
        }
    } else//ODControl
    {
        webView = (WebView) findViewById(R.id.webView1);

        webView.setHttpAuthUsernamePassword(uriToDisplay, "/", "user@opendomo.com", "opendomo");
        webView.setWebChromeClient(new WebChromeClient());
        webView.setWebViewClient(new MyWebViewClient());
        webView.getSettings().setJavaScriptEnabled(true);
        webView.loadUrl("http://local.opendomo.com");

    }

}

From source file:com.ezeeideas.wordjam.TestDialog.java

public TestDialog(Context context, int type, String answer) {
    super(context);
    mContext = context;//from  ww w  .ja  v a 2  s .c om

    mType = type;
    mAnswer = answer;

    mListener = (TestDialogListener) mContext;

    //don't show a title
    requestWindowFeature(Window.FEATURE_NO_TITLE);

    //initialize the view based on the type
    refreshData();
}

From source file:org.golang.app.WViewActivity.java

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

    //Fixed Portrait orientation
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

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

    setContentView(R.layout.webview);//from w  w  w  .  j a  v a  2s .c  o m
    WebView webView = (WebView) findViewById(R.id.webView1);

    initWebView(webView);
    webView.setWebViewClient(new WebViewClient() {

        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            Log.d("JavaGoWV: ", url);

            final Pattern p = Pattern.compile("dcoinKey&password=(.*)$");
            final Matcher m = p.matcher(url);
            if (m.find()) {
                try {
                    Thread thread = new Thread(new Runnable() {
                        @Override
                        public void run() {
                            try {
                                //File root = android.os.Environment.getExternalStorageDirectory();
                                File dir = Environment
                                        .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
                                Log.d("JavaGoWV", "dir " + dir);

                                URL keyUrl = new URL(
                                        "http://127.0.0.1:8089/ajax?controllerName=dcoinKey&first=1"); //you can write here any link
                                //URL keyUrl = new URL("http://yandex.ru/"); //you can write here any link
                                File file = new File(dir, "dcoin-key.png");

                                long startTime = System.currentTimeMillis();
                                Log.d("JavaGoWV", "download begining");
                                Log.d("JavaGoWV", "download keyUrl:" + keyUrl);

                                /* Open a connection to that URL. */
                                URLConnection ucon = keyUrl.openConnection();

                                Log.d("JavaGoWV", "0");
                                /*
                                * Define InputStreams to read from the URLConnection.
                                */
                                InputStream is = ucon.getInputStream();

                                Log.d("JavaGoWV", "01");

                                BufferedInputStream bis = new BufferedInputStream(is);

                                Log.d("JavaGoWV", "1");
                                /*
                                * Read bytes to the Buffer until there is nothing more to read(-1).
                                */
                                ByteArrayBuffer baf = new ByteArrayBuffer(5000);
                                int current = 0;
                                while ((current = bis.read()) != -1) {
                                    baf.append((byte) current);
                                }

                                Log.d("JavaGoWV", "2");
                                /* Convert the Bytes read to a String. */
                                FileOutputStream fos = new FileOutputStream(file);
                                fos.write(baf.toByteArray());
                                fos.flush();
                                fos.close();

                                Log.d("JavaGoWV", "3");
                                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                                    Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
                                    Uri contentUri = Uri.fromFile(file);
                                    mediaScanIntent.setData(contentUri);
                                    WViewActivity.this.sendBroadcast(mediaScanIntent);
                                } else {
                                    sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED,
                                            Uri.parse("file://" + Environment.getExternalStorageDirectory())));
                                }

                                Log.d("JavaGoWV", "4");
                            } catch (Exception e) {
                                Log.e("JavaGoWV error 0", e.toString());
                                e.printStackTrace();
                            }
                        }
                    });
                    thread.start();

                } catch (Exception e) {
                    Log.e("JavaGoWV error", e.toString());
                    e.printStackTrace();
                }
            }
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {

            Log.e("JavaGoWV", "shouldOverrideUrlLoading " + url);

            if (url.endsWith(".mp4")) {
                Intent in = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
                startActivity(in);
                return true;
            } else {
                return false;
            }
        }

        @Override
        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
            Log.d("JavaGoWV",
                    "failed: " + failingUrl + ", error code: " + errorCode + " [" + description + "]");
        }
    });

    SystemClock.sleep(1500);
    //if (MyService.DcoinStarted(8089)) {
    webView.loadUrl("http://localhost:8089/");
    //}

}

From source file:com.fbbackup.TagImageDetailActivity.java

@TargetApi(11)
@Override/*  w w  w . j  a  v  a 2s  .co  m*/
public void onCreate(Bundle savedInstanceState) {
    if (BuildConfig.DEBUG) {
        Utils.enableStrictMode();
    }
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);

    setContentView(R.layout.image_detail_pager);

    extStorageDirectory = Environment.getExternalStorageDirectory().toString();

    // Fetch screen height and width, to use as our max size when loading
    // images as this
    // activity runs full screen
    final DisplayMetrics displayMetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
    final int height = displayMetrics.heightPixels;
    final int width = displayMetrics.widthPixels;

    photoArray = getIntent().getExtras().getStringArray("photo");
    albumName = "me";
    img_pos = getIntent().getExtras().getInt("albumPosition");

    name = getIntent().getExtras().getString("userName");

    //name = getIntent().getExtras().getString("userName");

    setView();
    setListener();

    // For this sample we'll use half of the longest width to resize our
    // images. As the
    // image scaling ensures the image is larger than this, we should be
    // left with a
    // resolution that is appropriate for both portrait and landscape. For
    // best image quality
    // we shouldn't divide by 2, but this will use more memory and require a
    // larger memory
    // cache.
    final int longest = (height > width ? height : width) / 2;

    ImageCache.ImageCacheParams cacheParams = new ImageCache.ImageCacheParams(this, IMAGE_CACHE_DIR);
    cacheParams.setMemCacheSizePercent(0.25f); // Set memory cache to 25% of
    // app memory

    // The ImageFetcher takes care of loading images into our ImageView
    // children asynchronously
    mImageFetcher = new ImageFetcher(this, longest);
    mImageFetcher.addImageCache(getSupportFragmentManager(), cacheParams);
    mImageFetcher.setImageFadeIn(false);

    // Set up ViewPager and backing adapter
    mAdapter = new ImagePagerAdapter(getSupportFragmentManager(), photoArray.length);
    mPager = (ViewPager) findViewById(R.id.pager);
    mPager.setAdapter(mAdapter);
    mPager.setPageMargin((int) getResources().getDimension(R.dimen.image_detail_pager_margin));
    mPager.setOffscreenPageLimit(2);
    mPager.setOnPageChangeListener(new MyOnPageChangeListener());

    // Set up activity to go full screen
    getWindow().addFlags(LayoutParams.FLAG_FULLSCREEN);

    // Enable some additional newer visibility and ActionBar features to
    // create a more
    // immersive photo viewing experience
    //      if (Utils.hasHoneycomb()) {
    //         final ActionBar actionBar = getActionBar();
    //
    //         // Hide title text and set home as up
    //         actionBar.setDisplayShowTitleEnabled(false);
    //         actionBar.setDisplayHomeAsUpEnabled(true);
    //
    //         // Hide and show the ActionBar as the visibility changes
    //         mPager.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
    //            @Override
    //            public void onSystemUiVisibilityChange(int vis) {
    //               if ((vis & View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0) {
    //                  actionBar.hide();
    //               } else {
    //                  actionBar.show();
    //               }
    //            }
    //         });
    //
    //         // Start low profile mode and hide ActionBar
    //         mPager.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
    //         actionBar.hide();
    //      }

    // Set the current item based on the extra passed in to this activity
    final int extraCurrentItem = getIntent().getIntExtra(EXTRA_IMAGE, -1);
    if (extraCurrentItem != -1) {
        mPager.setCurrentItem(extraCurrentItem);
    }
}

From source file:biz.easymenu.easymenung.ConfirmDialog.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View v = li.inflate(R.layout.confirmdialog, container, false);
    ((TextView) v.findViewById(R.id.txtConfDlg)).setText(text);

    btnYes = (Button) v.findViewById(R.id.btnConfDlgYes);
    btnNo = (Button) v.findViewById(R.id.btnConfDlgNo);

    btnYes.setText(yesStr);//from  w w  w.j  a v  a2s .  c  o m
    btnNo.setText(noStr);

    WindowManager.LayoutParams WMLP = this.getDialog().getWindow().getAttributes();
    WMLP.y = 100; //y position
    WMLP.gravity = Gravity.TOP;
    WMLP.windowAnimations = R.style.PauseDialogAnimation;
    this.getDialog().getWindow().setAttributes(WMLP);
    this.getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);

    btnYes.setOnClickListener(yesListener);
    btnNo.setOnClickListener(noListener);

    return v;
}

From source file:com.guess.license.plate.Task.LoadingTaskConn.java

/**
 * A Loading task that will load some resources that are necessary for the app to start
 * @param progressBar - the progress bar you want to update while the task is in progress
 * @param finishedListener - the listener that will be told when this task is finished
 *//*  w w  w .  j  a v  a  2  s.  c  o  m*/
public LoadingTaskConn(Context context, SplashActivity activity) {
    this.context = context;
    this.activity = activity;

    // Progress Dialog
    this.loadingDialog = new ProgressDialog(activity, android.R.style.Theme_Translucent);
    this.loadingDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    this.loadingDialog.setCancelable(false);
    if (!this.loadingDialog.isShowing()) {
        this.loadingDialog.show();
    }
    this.loadingDialog.setContentView(R.layout.custom_progress_dialog);
}

From source file:org.openremote.android.console.Main.java

/** Called when the activity is first created. */
@Override//from   w ww.  j  a v  a  2 s.c  om
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

    loadingToast = Toast.makeText(this, "Refreshing from Controller...", Integer.MAX_VALUE);
    if (!isRefreshingController) {
        ImageUtil.setContentViewQuietly(this, R.layout.welcome_view);
    } else {
        loadingToast.show();
    }
    isRefreshingController = false;

    //Load the current group        
    checkNetType();
    readDisplayMetrics();

    if (!checkServerAndPanel()) {
        new AsyncResourceLoader(Main.this).execute((Void) null);
    }
}