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.usertaxi.TaxiArrived_Acitivity.java

private void initiatePopupWindowcanceltaxi() {
    try {/*from w ww  . j  a v a  2 s .c  om*/
        dialog = new Dialog(TaxiArrived_Acitivity.this);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); // before
        dialog.setContentView(R.layout.canceltaxi_popup);

        cross = (ImageButton) dialog.findViewById(R.id.cross);
        cross.setOnClickListener(cancle_btn_click_listener);
        rd1 = (RadioButton) dialog.findViewById(R.id.radioButton);
        rd2 = (RadioButton) dialog.findViewById(R.id.radioButton2);
        rd3 = (RadioButton) dialog.findViewById(R.id.radioButton3);
        btn_confirm = (Button) dialog.findViewById(R.id.btn_acceptor);
        TextView txt = (TextView) dialog.findViewById(R.id.textView);
        textheader = (TextView) dialog.findViewById(R.id.popup_text);

        Typeface tf = Typeface.createFromAsset(this.getAssets(), "Montserrat-Regular.ttf");
        rd1.setTypeface(tf);
        rd2.setTypeface(tf);
        rd3.setTypeface(tf);
        btn_confirm.setTypeface(tf);
        txt.setTypeface(tf);
        textheader.setTypeface(tf);
        btn_confirm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (rd1.isChecked()) {
                    canceltaxirequest = getResources().getString(R.string.prompt_canceltaxione);

                } else if (rd2.isChecked()) {
                    canceltaxirequest = getResources().getString(R.string.prompt_cancel_reason_two);

                } else if (rd3.isChecked()) {
                    canceltaxirequest = getResources().getString(R.string.prompt_cancel_reason_three);

                }

                Allbeans allbeans = new Allbeans();

                allbeans.setCanceltaxirequest(canceltaxirequest);

                new CancelTaxiAsynch(allbeans).execute();

            }
        });
        dialog.show();

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

From source file:com.agustinprats.myhrv.MainActivity.java

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

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

    //Remove title bar
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);

    //Remove notification bar
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    //set content view AFTER ABOVE sequence (to avoid crash)
    this.setContentView(R.layout.fragment_basic_monitor_video);

    final Uri uri = getIntent().getData();
    // set previously saved theme
    //  setTheme(isLightTheme() ? R.style.LightTheme : R.style.DarkTheme);

    // elad change set theme to dark
    setTheme(R.style.LightTheme);/*from   www. j av a2  s  .c  o  m*/

    //        setContentView(R.layout.activity_main);

    // Elad different services
    // Connect to Bluetooth service
    //Intent serviceIntent = new Intent(this, BleHeartRateService.class);
    //Intent serviceIntent = new Intent(this, BleHeartRateServiceElad.class);
    Intent serviceIntent = new Intent(this, SamsungS5HeartRateService.class);
    //Intent serviceIntent = new Intent(this, CameraHeartRateService.class);
    //Intent serviceIntent = new Intent(this, MockHeartRateService.class);
    //Intent serviceIntent = new Intent(this, USBSPOHeartRateService.class);
    bindService(serviceIntent, _heartRateServiceConn, BIND_AUTO_CREATE);
    Log.d(TAG, "binding with BleHeartRateService service");

    // Init monitor fragment
    if (savedInstanceState == null) {
        final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        // Adds a newly created ContactDetailFragment that is instantiated with the
        // data Uri

        // Elad Camera

        _monitorFragment = BasicMonitorFragment.newInstance(uri);
        ft.add(android.R.id.content, _monitorFragment, TAG);
        ft.commit();
        /*
                  getFragmentManager().beginTransaction()
            .add(R.id.container, _monitorFragment)
            .commit(); */
    }
}

From source file:com.dragon4.owo.ar_trace.ARCore.MixView.java

@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    DataSource.createIcons(getResources());

    try {/*from w w  w. j a  va 2s . co m*/
        // ??
        final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
        // ?    ?? ?
        this.mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "My Tag");
        // ?? 
        locationMgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        //  ?? . 2 ?? (1/1000s), 3 ?? (m)? ? 
        locationMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 3, this);

        //orientation sensor 
        sensorMgr_ori = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
        orientationSensor = sensorMgr_ori.getDefaultSensor(Sensor.TYPE_ORIENTATION);

        killOnError(); // ?  ?
        requestWindowFeature(Window.FEATURE_NO_TITLE); // ?   ? 

        //  ?? 
        FrameLayout frameLayout = new FrameLayout(this);

        //  ?    ?, ? 
        frameLayout.setMinimumWidth(3000);
        frameLayout.setPadding(10, 0, 10, 10);

        // ? ? ? ?? ?
        camScreen = new CameraSurface(this);
        augScreen = new AugmentedView(this);
        setContentView(camScreen); // ? ?? ?  ? 

        // ? ?? ? 
        addContentView(augScreen, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

        // ? ? ? ?   ?.
        // ? ?  ?  ?? ?  ?  ?
        addContentView(frameLayout, new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,
                LayoutParams.WRAP_CONTENT, Gravity.BOTTOM));

        topLayoutOnMixView = new TopLayoutOnMixView(this);
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
        addContentView(topLayoutOnMixView.mainArView, params);

        // ? ? ? topLayoutOnMixView ?  ?
        handleIntent(getIntent()); // ?? 

        //  ? ? ?
        if (!isInited) {
            mixContext = new MixContext(this); // ? ?
            // ? ?
            mixContext.downloadManager = new DownloadManager(mixContext);

            //? ?  ? 
            navigator = new Navigator(mixContext, topLayoutOnMixView.naverFragment);

            // ? ? ?? ? ?
            dWindow = new PaintScreen();
            dataView = new DataView(mixContext);

            isInited = true; //   true

        }

        if (mixContext.isActualLocation() == false) {
            Toast.makeText(this, getString(DataView.CONNECTION_GPS_DIALOG_TEXT), Toast.LENGTH_LONG).show();
        }

    } catch (Exception ex) {
        doError(ex); //  ? ? 
    }

    //   ? 
    IntentFilter naviBraodFilter = new IntentFilter();
    naviBraodFilter.addAction("NAVI");
    registerReceiver(naviRecevicer, naviBraodFilter);
}

From source file:com.frostwire.android.gui.util.UIUtils.java

/**
 * @param context                         -  containing Context.
 * @param showInstallationCompleteSection - true if you want to display "Your installation is now complete. Thank You" section
 * @param dismissListener                 - what happens when the dialog is dismissed.
 * @param referrerContextSuffix           - string appended at the end of social pages click urls's ?ref=_android_ parameter.
 *///from   ww  w .  j  a v  a2  s .com
public static void showSocialLinksDialog(final Context context, boolean showInstallationCompleteSection,
        DialogInterface.OnDismissListener dismissListener, String referrerContextSuffix) {
    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    View customView = View.inflate(context, R.layout.view_social_buttons, null);
    builder.setView(customView);
    builder.setPositiveButton(context.getString(android.R.string.ok), (dialog, which) -> dialog.dismiss());
    final AlertDialog socialLinksDialog = builder.create();
    socialLinksDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    socialLinksDialog.setOnDismissListener(dismissListener);
    ImageButton fbButton = customView.findViewById(R.id.view_social_buttons_facebook_button);
    ImageButton twitterButton = customView.findViewById(R.id.view_social_buttons_twitter_button);
    ImageButton redditButton = customView.findViewById(R.id.view_social_buttons_reddit_button);
    final String referrerParam = "?ref=android_"
            + ((referrerContextSuffix != null) ? referrerContextSuffix.trim() : "");
    fbButton.setOnClickListener(
            v -> UIUtils.openURL(v.getContext(), Constants.SOCIAL_URL_FACEBOOK_PAGE + referrerParam));
    twitterButton.setOnClickListener(
            v -> UIUtils.openURL(v.getContext(), Constants.SOCIAL_URL_TWITTER_PAGE + referrerParam));
    redditButton.setOnClickListener(
            v -> UIUtils.openURL(v.getContext(), Constants.SOCIAL_URL_REDDIT_PAGE + referrerParam));
    if (showInstallationCompleteSection) {
        LinearLayout installationCompleteLayout = customView
                .findViewById(R.id.view_social_buttons_installation_complete_layout);
        installationCompleteLayout.setVisibility(View.VISIBLE);
        ImageButton dismissCheckButton = customView.findViewById(R.id.view_social_buttons_dismiss_check);
        dismissCheckButton.setOnClickListener(v -> socialLinksDialog.dismiss());
    }
    socialLinksDialog.show();
}

From source file:co.taqat.call.StatusFragment.java

public void showZRTPDialog(final LinphoneCall call) {
    if (getActivity() == null) {
        Log.w("Can't display ZRTP popup, no Activity");
        return;//w w w  . ja v a2  s.  co  m
    }

    if (ZRTPdialog == null || !ZRTPdialog.isShowing()) {
        ZRTPdialog = new Dialog(getActivity());
        ZRTPdialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        Drawable d = new ColorDrawable(ContextCompat.getColor(getActivity(), R.color.colorC));
        d.setAlpha(200);
        ZRTPdialog.setContentView(R.layout.dialog);
        ZRTPdialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT,
                WindowManager.LayoutParams.MATCH_PARENT);
        ZRTPdialog.getWindow().setBackgroundDrawable(d);

        TextView customText = (TextView) ZRTPdialog.findViewById(R.id.customText);
        String newText = getString(R.string.zrtp_dialog).replace("%s", call.getAuthenticationToken());
        customText.setText(newText);
        Button delete = (Button) ZRTPdialog.findViewById(R.id.delete_button);
        delete.setText(R.string.accept);
        Button cancel = (Button) ZRTPdialog.findViewById(R.id.cancel);
        cancel.setText(R.string.deny);

        delete.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                call.setAuthenticationTokenVerified(true);
                if (encryption != null) {
                    encryption.setImageResource(R.drawable.security_ok);
                }
                ZRTPdialog.dismiss();
            }
        });

        cancel.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                if (call != null) {
                    call.setAuthenticationTokenVerified(false);
                    if (encryption != null) {
                        encryption.setImageResource(R.drawable.security_ko);
                    }
                }
                ZRTPdialog.dismiss();
            }
        });
        ZRTPdialog.show();
    }
}

From source file:com.zen.androidhtmleditor.AHEActivity.java

@SuppressLint("NewApi")
@Override//  w w  w .ja  v a 2  s . c o m
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
            WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    setContentView(R.layout.main);
    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    // enable status bar tint
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setTintColor(Color.parseColor("#4acab4"));

    SharedPreferences settings = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
    Settings.init(settings);
    //Uncomment this for non Market installs. This will allow version checking.
    //new Version(this,getVersionName(this,DeveloperToolsActivity.class),"http://androidhtmleditor.com/version.php").execute();
    deviceId = Secure.getString(this.getContentResolver(), Secure.ANDROID_ID);
    getOverflowMenu();
    getActionBar().setIcon(R.drawable.icon_white);

    tabactivity = (TabActivity) this;
    tabHost = tabactivity.getTabHost();
    hsv = (HorizontalScrollView) tabactivity.findViewById(R.id.topmenu);

    mLicenseCheckerCallback = new MyLicenseCheckerCallback();
    mChecker = new LicenseChecker(this,
            new ServerManagedPolicy(this, new AESObfuscator(SALT, getPackageName(), deviceId)),
            BASE64_PUBLIC_KEY // Your public licensing key.
    );

    mHandler = new Handler();
    // doCheck();

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerList = (LinearLayout) findViewById(R.id.l1);

    // ActionBarDrawerToggle ties together the the proper interactions
    // between the sliding drawer and the action bar app icon
    mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
            mDrawerLayout, /* DrawerLayout object */
            R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
            R.string.drawer_open, /* "open drawer" description for accessibility */
            R.string.drawer_close /* "close drawer" description for accessibility */
    ) {
        public void onDrawerClosed(View view) {
            getActionBar().setTitle("File(s)");
            invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
        }

        public void onDrawerOpened(View drawerView) {
            getActionBar().setTitle("Server");
            invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
        }
    };
    mDrawerLayout.setDrawerListener(mDrawerToggle);

    Button button1 = (Button) findViewById(R.id.button1);

    button1.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            onButtonClickEvent(v);
        }
    });
    Button disconnect_button = (Button) findViewById(R.id.disconnect_button);

    disconnect_button.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            disconnect();
        }
    });

    /* Button button2 = (Button)findViewById(R.id.button2);
     button2.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
               
       hsv.setVisibility(View.GONE);
       v.setVisibility(View.GONE);
       RelativeLayout rl = (RelativeLayout)v.getParent();
       Button button1 = (Button)findViewById(R.id.button1);
       button1.setVisibility(View.VISIBLE);
       Button button3 = (Button)findViewById(R.id.button3);
       button3.setVisibility(View.VISIBLE);
               
       ImageView logo = (ImageView)findViewById(R.id.logo);
       logo.setVisibility(View.VISIBLE);
               
       TextView slogan = (TextView)findViewById(R.id.appSlogan);
       slogan.setVisibility(View.VISIBLE);
               
       ScrollView frontLayout = (ScrollView)findViewById(R.id.front);
       frontLayout.setVisibility(View.VISIBLE);
               
       TextView appTitle = (TextView)findViewById(R.id.appTitle);
       appTitle.setVisibility(View.VISIBLE);
               
       Button backButton = (Button)rl.findViewById(R.id.backButton);
       backButton.setVisibility(View.GONE);
       arrayAdapter.clear();
       arrayAdapter.notifyDataSetChanged();
       TextView pathInfo = (TextView)rl.findViewById(R.id.path);
        pathInfo.setText("");
        folderPath = "";
       //new MyFetchTask("zenstudio.com.au", "zenstudi", ".-x$%Wmd5b#C","folder",folderPath).execute();
        connectedTo = -1;
                
                
                
                
        Toast.makeText(AHEActivity.this, "Disconnected", Toast.LENGTH_SHORT).show();
    }
     });*/

    Button button3 = (Button) findViewById(R.id.button3);
    button3.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            Intent SettingsIntent = new Intent(AHEActivity.this, Settings.class);
            startActivity(SettingsIntent);
        }
    });

    /*Button backButton = (Button)findViewById(R.id.backButton);
    backButton.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
       String[] pathBits = folderPath.split("/");
       folderPath = "";
       for(int i=0;i<pathBits.length-1;i++){
          folderPath += pathBits[i]+"/";
       }
       arrayAdapter.clear();
               
       //connectedTo
       SharedPreferences settings = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
        String currentServers = settings.getString("Accounts", "");
        if(currentServers.equals("")){}else{
       Gson gson = new Gson();
        SearchResponse response = gson.fromJson(currentServers, SearchResponse.class);
        List<Result> results = response.data;
        Result l = results.get(connectedTo);
                
       if(l.serverName!="" && l.userName!="" && l.port.trim()!=""){
               
          if(l.sftp.equals("0") || l.sftp.equals("1") || l.sftp.equals("2")){
             new MyFetchTask(l.serverName, l.userName, l.passWord,"folder",folderPath,l.sftp,l.port).execute();
          }else if(l.sftp.equals("3")){
             new FetchSSLTask(l.serverName, l.userName, l.passWord,"folder",folderPath,l.sftp,l.port).execute();
          }
               
       }
                
        }
    }
    });*/

    TextView pathInfo = (TextView) findViewById(R.id.path);
    pathInfo.setText(folderPath);

    lstTest = (ListView) findViewById(R.id.list);
    // lstTest.setDividerHeight(10);
    lstTest.setPadding(0, 5, 0, 5);
    alrts = new ArrayList<String[]>();
    arrayAdapter = new FetchAdapter(AHEActivity.this, R.layout.listitems, alrts);
    lstTest.setAdapter(arrayAdapter);

    lstTest.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
        public boolean onItemLongClick(AdapterView<?> av, View v, int pos, long id) {
            final View d = v;
            final CharSequence[] items = { "Delete", "Rename", "Chmod", "Download" };

            TextView t = (TextView) v.findViewById(R.id.fileFolderName);
            final String oldName = t.getText().toString();

            final int position = pos;

            AlertDialog.Builder builder = new AlertDialog.Builder(AHEActivity.this);
            builder.setTitle("Choose Action");
            builder.setItems(items, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int item) {

                    if (item == 0) {
                        AlertDialog.Builder dbuilder = new AlertDialog.Builder(AHEActivity.this);
                        dbuilder.setMessage("Delete this file?").setCancelable(false)
                                .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                                    public void onClick(DialogInterface dialog, int id) {

                                        deleteFile(d);
                                        dialog.cancel();
                                    }
                                }).setNegativeButton("No", new DialogInterface.OnClickListener() {
                                    public void onClick(DialogInterface dialog, int id) {
                                        dialog.cancel();

                                    }
                                });
                        AlertDialog dalert = dbuilder.create();
                        dalert.show();

                    } else if (item == 1) {

                        final Dialog renameDialog = new Dialog(AHEActivity.this);
                        renameDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                        renameDialog.setContentView(R.layout.renamediag);

                        renameDialog.setCancelable(true);

                        Button closeServer = (Button) renameDialog.findViewById(R.id.closeServer);
                        closeServer.setOnClickListener(new OnClickListener() {
                            public void onClick(View v) {

                                renameDialog.cancel();
                            }
                        });

                        Button saveServer = (Button) renameDialog.findViewById(R.id.saveServer);
                        saveServer.setOnClickListener(new OnClickListener() {
                            public void onClick(View v) {

                                EditText themeUrl = (EditText) renameDialog.findViewById(R.id.themeLink);
                                String newName = themeUrl.getText().toString();
                                //connectedTo
                                SharedPreferences settings = getSharedPreferences(PREFS_NAME,
                                        Context.MODE_PRIVATE);
                                String currentServers = settings.getString("Accounts", "");
                                if (currentServers.equals("")) {
                                } else {
                                    Gson gson = new Gson();
                                    SearchResponse response = gson.fromJson(currentServers,
                                            SearchResponse.class);
                                    List<Result> results = response.data;
                                    Result l = results.get(connectedTo);

                                    if (l.serverName != "" && l.userName != "" && l.port.trim() != "") {

                                        new RenameTask(l.serverName, l.userName, l.passWord, oldName, newName,
                                                folderPath, l.sftp, l.port, position).execute();

                                        renameDialog.cancel();
                                    }
                                }
                            }
                        });
                        renameDialog.show();
                    } else if (item == 2) {

                        final Dialog chmodDialog = new Dialog(AHEActivity.this);
                        chmodDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                        chmodDialog.setContentView(R.layout.chmoddiag);

                        chmodDialog.setCancelable(true);

                        Button closeServer = (Button) chmodDialog.findViewById(R.id.closeServer);
                        closeServer.setOnClickListener(new OnClickListener() {
                            public void onClick(View v) {

                                chmodDialog.cancel();
                            }
                        });

                        Button saveServer = (Button) chmodDialog.findViewById(R.id.saveServer);
                        saveServer.setOnClickListener(new OnClickListener() {
                            public void onClick(View v) {

                                EditText themeUrl = (EditText) chmodDialog.findViewById(R.id.themeLink);
                                String perms = themeUrl.getText().toString();
                                //connectedTo
                                SharedPreferences settings = getSharedPreferences(PREFS_NAME,
                                        Context.MODE_PRIVATE);
                                String currentServers = settings.getString("Accounts", "");
                                if (currentServers.equals("")) {
                                } else {
                                    Gson gson = new Gson();
                                    SearchResponse response = gson.fromJson(currentServers,
                                            SearchResponse.class);
                                    List<Result> results = response.data;
                                    Result l = results.get(connectedTo);

                                    if (l.serverName != "" && l.userName != "" && l.port.trim() != "") {

                                        if (l.sftp.equals("0") || l.sftp.equals("1") || l.sftp.equals("2")) {
                                            new ChmodTask(l.serverName, l.userName, l.passWord, oldName, perms,
                                                    folderPath, l.sftp, l.port, position).execute();
                                        } else {
                                            Toast.makeText(AHEActivity.this,
                                                    "CHMOD could not be performed on your server via sftp",
                                                    Toast.LENGTH_SHORT).show();
                                        }
                                        chmodDialog.cancel();
                                    }
                                }
                            }
                        });
                        chmodDialog.show();

                    } else if (item == 3) {

                        //Make new class to download a file
                        SharedPreferences settings = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
                        String currentServers = settings.getString("Accounts", "");
                        if (currentServers.equals("")) {
                        } else {
                            Gson gson = new Gson();
                            SearchResponse response = gson.fromJson(currentServers, SearchResponse.class);
                            List<Result> results = response.data;
                            Result l = results.get(connectedTo);

                            if (l.serverName != "" && l.userName != "" && l.port.trim() != "") {

                                if (l.sftp.equals("0") || l.sftp.equals("1") || l.sftp.equals("2")) {
                                    new DlTask(l.serverName, l.userName, l.passWord, oldName, l.sftp, l.port)
                                            .execute();

                                }
                            }
                        }
                    }

                    //Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();

                }
            });
            AlertDialog alert = builder.create();
            alert.show();
            return true;

        }
    });

    lstTest.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        public void onItemClick(AdapterView<?> av, View v, int pos, long id) {

            loadFileFolder(v);

        }
    });

}

From source file:com.entertailion.android.launcher.Dialogs.java

/**
 * Display the list of browser bookmarks. Allow user to load bookmarked web
 * site./* w w  w  .java  2  s  . c o  m*/
 * 
 * @param context
 */
public static void displayBookmarks(final Launcher context) {
    final ArrayList<BookmarkInfo> bookmarks = loadBookmarks(context);
    if (bookmarks.size() > 0) {
        final Dialog dialog = new Dialog(context);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setContentView(R.layout.bookmarks_list);

        ListView listView = (ListView) dialog.findViewById(R.id.list);
        Collections.sort(bookmarks, new Comparator<BookmarkInfo>() {

            @Override
            public int compare(BookmarkInfo lhs, BookmarkInfo rhs) {
                return lhs.getTitle().toLowerCase().compareTo(rhs.getTitle().toLowerCase());
            }

        });
        listView.setAdapter(new BookmarkAdapter(context, bookmarks));
        listView.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                BookmarkInfo bookmark = (BookmarkInfo) parent.getAdapter().getItem(position);
                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(bookmark.getUrl()));
                context.startActivity(browserIntent);
                context.showCover(false);
                dialog.dismiss();
                Analytics.logEvent(Analytics.INVOKE_BOOKMARK);
            }

        });
        listView.setDrawingCacheEnabled(true);
        listView.setOnKeyListener(onKeyListener);
        dialog.setOnDismissListener(new OnDismissListener() {

            @Override
            public void onDismiss(DialogInterface dialog) {
                context.showCover(false);
            }

        });
        context.showCover(true);
        dialog.show();
        Analytics.logEvent(Analytics.DIALOG_BOOKMARKS);
    } else {
        displayAlert(context, context.getString(R.string.dialog_no_browser_bookmarks));
    }
}

From source file:com.actionbarsherlock.plus.SherlockDialogPlusFragment.java

/** @hide */
@Override/*from w w w.ja  v  a  2 s. c  o  m*/
public LayoutInflater getLayoutInflater(Bundle savedInstanceState) {
    if (!mShowsDialog) {
        return super.getLayoutInflater(savedInstanceState);
    }

    mDialog = onCreateDialog(savedInstanceState);
    switch (mStyle) {
    case STYLE_NO_INPUT:
        mDialog.getWindow().addFlags(
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
        // fall through...
    case STYLE_NO_FRAME:
    case STYLE_NO_TITLE:
        mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    }
    mDialog.setCancelable(true);
    mDialog.setCanceledOnTouchOutside(true);
    mDialog.getWindow().setGravity(mGravity);
    if (mDialog != null) {
        return (LayoutInflater) mDialog.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }
    return (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}

From source file:com.corporatetaxi.TaxiArrived_Acitivity.java

private void initiatePopupWindowcanceltaxi() {
    try {/*w  w w  . ja va  2  s .c  om*/
        dialog = new Dialog(TaxiArrived_Acitivity.this);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); // before
        dialog.setContentView(R.layout.canceltaxi_popup);

        cross = (ImageButton) dialog.findViewById(R.id.cross);
        cross.setOnClickListener(cancle_btn_click_listener);
        rd1 = (RadioButton) dialog.findViewById(R.id.radioButton);
        rd2 = (RadioButton) dialog.findViewById(R.id.radioButton2);
        rd3 = (RadioButton) dialog.findViewById(R.id.radioButton3);
        btn_confirm = (Button) dialog.findViewById(R.id.btn_acceptor);
        TextView txt = (TextView) dialog.findViewById(R.id.textView);
        textheader = (TextView) dialog.findViewById(R.id.popup_text);
        Typeface tf = Typeface.createFromAsset(this.getAssets(), "Montserrat-Regular.ttf");
        rd1.setTypeface(tf);
        rd2.setTypeface(tf);
        rd3.setTypeface(tf);
        btn_confirm.setTypeface(tf);
        txt.setTypeface(tf);
        textheader.setTypeface(tf);
        btn_confirm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (rd1.isChecked()) {
                    canceltaxirequest = getResources().getString(R.string.prompt_cancel_reason_one);

                } else if (rd2.isChecked()) {
                    canceltaxirequest = getResources().getString(R.string.prompt_cancel_reason_two);

                } else if (rd3.isChecked()) {
                    canceltaxirequest = getResources().getString(R.string.prompt_cancel_reason_three);

                }

                Allbeans allbeans = new Allbeans();

                allbeans.setCanceltaxirequest(canceltaxirequest);

                new CancelTaxiAsynch(allbeans).execute();

            }
        });
        dialog.show();

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

From source file:com.example.android.navigationdrawer.QRCode.java

public void onQR(View v) {
    switch (v.getId()) {
    case R.id.button1:
        String qrInputText = MidiFile.readString;

        //Find screen size
        WindowManager manager = (WindowManager) getSystemService(WINDOW_SERVICE);
        Display display = manager.getDefaultDisplay();
        Point point = new Point();
        display.getSize(point);//from w  ww.ja  v a 2 s .  c  o  m
        int width = point.x;
        int height = point.y;
        int smallerDimension = width < height ? width : height;
        smallerDimension = smallerDimension * 3 / 4;
        //Encode with a QR Code image
        QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(qrInputText, null, Contents.Type.TEXT,
                BarcodeFormat.QR_CODE.toString(), smallerDimension);
        try {
            Bitmap bitmap = qrCodeEncoder.encodeAsBitmap();
            ImageView myImage = (ImageView) findViewById(R.id.imageView1);
            myImage.setImageBitmap(bitmap);

            // Get screen size
            Display display1 = this.getWindowManager().getDefaultDisplay();
            Point size = new Point();
            display1.getSize(size);
            int screenWidth = size.x;
            int screenHeight = size.y;

            // Get target image size
            Bitmap bitmap1 = qrCodeEncoder.encodeAsBitmap();
            int bitmapHeight = bitmap1.getHeight();
            int bitmapWidth = bitmap1.getWidth();

            // Scale the image down to fit perfectly into the screen
            // The value (250 in this case) must be adjusted for phone/tables displays
            while (bitmapHeight > (screenHeight - 250) || bitmapWidth > (screenWidth - 250)) {
                bitmapHeight = bitmapHeight / 2;
                bitmapWidth = bitmapWidth / 2;
            }

            // Create resized bitmap image
            BitmapDrawable resizedBitmap = new BitmapDrawable(this.getResources(),
                    Bitmap.createScaledBitmap(bitmap, bitmapWidth, bitmapHeight, false));

            // Create dialog
            Dialog dialog = new Dialog(this);
            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
            dialog.setContentView(R.layout.thumbnail);

            ImageView image = (ImageView) dialog.findViewById(R.id.imageview);

            // !!! Do here setBackground() instead of setImageDrawable() !!! //
            image.setBackground(resizedBitmap);

            // Without this line there is a very small border around the image (1px)
            // In my opinion it looks much better without it, so the choice is up to you.
            dialog.getWindow().setBackgroundDrawable(null);
            dialog.show();

        } catch (WriterException e) {
            e.printStackTrace();
        }
        break;
    }
}