Example usage for android.view Window FEATURE_LEFT_ICON

List of usage examples for android.view Window FEATURE_LEFT_ICON

Introduction

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

Prototype

int FEATURE_LEFT_ICON

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

Click Source Link

Document

Flag for having an icon on the left side of the title bar

Usage

From source file:org.alfresco.mobile.android.application.extension.samsung.pen.SNotePagesDialogFragment.java

@Override
public void onStart() {
    getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
    getDialog().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.mime_pages);
    super.onStart();
}

From source file:org.alfresco.mobile.android.application.extension.samsung.pen.SNotePagesDialogFragment.java

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

    getDialog().setTitle(R.string.editor_pages_move);
    getDialog().requestWindowFeature(Window.FEATURE_LEFT_ICON);

    ViewGroup v = (ViewGroup) inflater.inflate(R.layout.snote_pages, container, false);

    int width = (int) Math.round(UIUtils.getScreenDimension(getActivity())[0] * (Float.parseFloat(
            getResources().getString(android.R.dimen.dialog_min_width_major).replace("%", "")) * 0.01));
    v.setLayoutParams(new LayoutParams(width, LayoutParams.MATCH_PARENT));

    final SeekBar seekbar = ((SeekBar) v.findViewById(R.id.seekbar_pages));
    final TextView tv = ((TextView) v.findViewById(R.id.pages_number));
    tv.setText(String.valueOf(originPageNumber + 1) + " / " + String.valueOf(totalPages));

    seekbar.setMax(totalPages - 1);//from   w w w  .jav a2  s .  c  o  m
    seekbar.setProgress(originPageNumber);
    seekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            currentPageNumber = progress + 1;
            tv.setText(String.valueOf(currentPageNumber) + " / " + String.valueOf(totalPages));
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });

    final Button validate = (Button) v.findViewById(R.id.create_document);
    final Button cancel = (Button) v.findViewById(R.id.cancel);

    validate.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            ((SNoteEditorActivity) getActivity()).movePage(currentPageNumber - 1);
            dismiss();
        }
    });

    cancel.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            SNotePagesDialogFragment.this.dismiss();
        }
    });

    return v;
}

From source file:com.fabernovel.alertevoirie.ExistingIncidentsActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
    setContentView(R.layout.layout_existing_incidents);
    getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon_nouveau_rapport);

    // init button
    findViewById(R.id.Button_validate).setOnClickListener(new OnClickListener() {
        @Override/*from   w ww  .ja v  a2 s .c  o m*/
        public void onClick(View v) {
            startActivityForResult(new Intent(ExistingIncidentsActivity.this, SelectCategoryActivity.class), 0);
        }
    });
}

From source file:com.fabernovel.alertevoirie.NewsActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
    setContentView(R.layout.layout_report_lists);
    getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon_autour_de_vous);

    findViewById(R.id.RadioGroup_tabs).setVisibility(View.GONE);
    findViewById(R.id.ToggleButton01).setVisibility(View.GONE);
}

From source file:com.fabernovel.alertevoirie.MyIncidentsActivityMap.java

/** Called when the activity is first created. */
@Override/*from   ww  w. ja v a2s.  co  m*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
    setContentView(R.layout.layout_report_map);
    getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon_mes_rapports);

    map = (MapView) findViewById(R.id.MapView_mymap);
    map.setBuiltInZoomControls(true);
    tabs = (RadioGroup) findViewById(R.id.RadioGroup_tabs_map);

    // mOverlay = new SimpleItemizedOverlay(getResources().getDrawable(R.drawable.map_cursor), this, map);
    map.getOverlays().add(mOverlay);
    map.setSatellite(false);

    tbmap = (ToggleButton) findViewById(R.id.ToggleButton_Map);
    tbmap.setChecked(true);
    tbmap.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (!isChecked) {
                tbmap.setChecked(true);
                Intent i = new Intent(MyIncidentsActivityMap.this, MyIncidentsActivity.class);
                i.putExtra("tab1", title[0]);
                i.putExtra("tab2", title[1]);
                i.putExtra("tab3", title[2]);
                i.putExtra("datas", data.toString());
                i.putExtra("tab", checked);
                i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
                startActivity(i);
            }

        }
    });

    if (getIntent().getExtras().getInt("tab") != 0) {

        title[0] = getIntent().getExtras().getString("tab1");
        title[1] = getIntent().getExtras().getString("tab2");
        title[2] = getIntent().getExtras().getString("tab3");
        ((TextView) tabs.getChildAt(0)).setText(title[0]);
        if (title[0].startsWith("0"))
            ((TextView) tabs.getChildAt(0)).setEnabled(false);
        ((TextView) tabs.getChildAt(1)).setText(title[1]);
        if (title[1].startsWith("0"))
            ((TextView) tabs.getChildAt(1)).setEnabled(false);
        ((TextView) tabs.getChildAt(2)).setText(title[2]);
        if (title[2].startsWith("0"))
            ((TextView) tabs.getChildAt(2)).setEnabled(false);

        checked = getIntent().getExtras().getInt("tab");

        try {
            data = new JSONObject(getIntent().getExtras().getString("datas"));
        } catch (JSONException e) {
            Log.e(Constants.PROJECT_TAG, "JSon data exception", e);
        }

        // setMapForTab(gettabIndex(tabs.getCheckedRadioButtonId()));

    } else {

        // launch request
        try {
            AVService.getInstance(this)
                    .postJSON(new JSONArray().put(new JSONObject()
                            .put(JsonData.PARAM_REQUEST, JsonData.VALUE_REQUEST_GET_MY_INCIDENTS)
                            .put(JsonData.PARAM_UDID, Utils.getUdid(this))), this);
            showDialog(DIALOG_PROGRESS);
        } catch (JSONException e) {
            Log.e(Constants.PROJECT_TAG, "error launching My Incidents", e);
        }
    }

    // get view references
    tabs.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            Log.d(Constants.PROJECT_TAG, "checked : " + checkedId);
            checked = checkedId;
            setMapForTab(gettabIndex(checkedId));
        }
    });

    tabs.check(getId());

    if (checked == R.id.Tab_Map_ongoing) {
        setMapForTab(gettabIndex(checked));
    }

}

From source file:com.fabernovel.alertevoirie.IncidentsActivityMap.java

/** Called when the activity is first created. */
@Override//from   ww  w  .  j  a  v a  2  s  .c o m
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
    setContentView(R.layout.layout_report_map);
    getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon_autour_de_vous);

    map = (MapView) findViewById(R.id.MapView_mymap);
    tabs = (RadioGroup) findViewById(R.id.RadioGroup_tabs_map);

    findViewById(R.id.ToggleButton_Map).setVisibility(View.GONE);

    for (int i = 0; i < 3; i++) {
        int quantity = 0;
        String stitle = null;
        switch (i) {
        case 0:
            stitle = getResources().getQuantityString(R.plurals.home_label_current, quantity, quantity);
            break;
        case 1:
            stitle = getResources().getQuantityString(R.plurals.home_label_update, quantity, quantity);
            break;
        case 2:
            stitle = getResources().getQuantityString(R.plurals.home_label_solved, quantity, quantity);
            break;

        default:
            break;
        }
        title[i] = stitle;
        ((TextView) tabs.getChildAt(i)).setText(title[i]);
        ((TextView) tabs.getChildAt(i)).setEnabled(false);

    }

    // get view references
    tabs.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            Log.d(Constants.PROJECT_TAG, "checked : " + checkedId);
            checked = checkedId;
            setMapForTab(gettabIndex(checkedId));
        }
    });

    tabs.check(getId());

    /*
     * if (checked == R.id.Tab_Map_ongoing) {
     * setMapForTab(checked);
     * }
     */

}

From source file:org.alfresco.mobile.android.application.fragments.workflow.process.ProcessTasksFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (getDialog() != null) {
        getDialog().requestWindowFeature(Window.FEATURE_LEFT_ICON);
        getDialog().setTitle(R.string.tasks_history);
    }/*from   w  w w .  j ava  2 s  .com*/

    return super.onCreateView(inflater, container, savedInstanceState);
}

From source file:org.alfresco.mobile.android.application.fragments.workflow.process.ProcessTasksFragment.java

@Override
public void onResume() {
    if (getDialog() != null) {
        getDialog().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_validate);
    }/*from  w w w  . java 2  s .c o  m*/
    getActivity().invalidateOptionsMenu();
    super.onResume();
}

From source file:com.fabernovel.alertevoirie.MyIncidentsActivity.java

/** Called when the activity is first created. */
@Override/*from w w  w.j  a va2  s .c  o  m*/
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
    setContentView(R.layout.layout_report_lists);
    getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon_mes_rapports);
    tabs = (RadioGroup) findViewById(R.id.RadioGroup_tabs);
    tbmap = (ToggleButton) findViewById(R.id.ToggleButton01);
    tbmap.setChecked(false);
    tbmap.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                tbmap.setChecked(false);
                Intent i = new Intent(MyIncidentsActivity.this, MyIncidentsActivityMap.class);
                i.putExtra("tab1", title[0]);
                i.putExtra("tab2", title[1]);
                i.putExtra("tab3", title[2]);
                i.putExtra("datas", data.toString());
                i.putExtra("tab", checked);
                i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);// .addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
                startActivity(i);
                overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
            }

        }
    });

    if (getIntent().getExtras() != null) {

        title[0] = getIntent().getExtras().getString("tab1");
        title[1] = getIntent().getExtras().getString("tab2");
        title[2] = getIntent().getExtras().getString("tab3");
        ((TextView) tabs.getChildAt(0)).setText(title[0]);
        if (title[0].startsWith("0"))
            ((TextView) tabs.getChildAt(0)).setEnabled(false);
        ((TextView) tabs.getChildAt(1)).setText(title[1]);
        if (title[1].startsWith("0"))
            ((TextView) tabs.getChildAt(1)).setEnabled(false);
        ((TextView) tabs.getChildAt(2)).setText(title[2]);
        if (title[2].startsWith("0"))
            ((TextView) tabs.getChildAt(2)).setEnabled(false);

        checked = getIntent().getExtras().getInt("tab");

        try {
            data = new JSONObject(getIntent().getExtras().getString("datas"));
        } catch (JSONException e) {
            Log.e(Constants.PROJECT_TAG, "JSon data exception", e);
        }

        setAdapterForTab(gettabIndex(tabs.getCheckedRadioButtonId()));

    } else {
        // sendRequest();
    }

    // get view references

    tabs.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            Log.d(Constants.PROJECT_TAG, "checked : " + checkedId);
            checked = checkedId;
            setAdapterForTab(gettabIndex(checkedId));
        }
    });

    tabs.check(getId());
}

From source file:org.alfresco.mobile.android.application.accounts.fragment.AccountEditFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (getDialog() != null) {
        getDialog().setTitle(R.string.account_authentication);
        getDialog().requestWindowFeature(Window.FEATURE_LEFT_ICON);
    } else {//from   w w w .ja  v a  2 s.  c om
        UIUtils.displayTitle(getActivity(), R.string.account_authentication,
                !(getActivity() instanceof HomeScreenActivity));
    }

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

    validate = (Button) v.findViewById(R.id.next);
    validate.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            validateServer(v);
        }
    });

    final CheckBox sw = (CheckBox) v.findViewById(R.id.repository_https);
    final EditText portForm = (EditText) v.findViewById(R.id.repository_port);
    sw.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (!sw.isChecked() && (portForm.getText().toString().isEmpty()
                    || portForm.getText().toString().equals("443"))) {
                portForm.setText("80");
                AccessibilityHelper.addContentDescription(buttonView, R.string.account_https_off_hint);
            } else if (sw.isChecked() && (portForm.getText().toString().isEmpty()
                    || portForm.getText().toString().equals("80"))) {
                portForm.setText("443");
                AccessibilityHelper.addContentDescription(buttonView, R.string.account_https_on_hint);
            }
        }
    });

    sw.setChecked(true);
    portForm.setText("443");

    // Accessibility
    if (AccessibilityHelper.isEnabled(getActivity())) {
        ((EditText) v.findViewById(R.id.repository_username))
                .setHint(getString(R.string.account_username_required_hint));
        ((EditText) v.findViewById(R.id.repository_password))
                .setHint(getString(R.string.account_password_required_hint));
        ((EditText) v.findViewById(R.id.repository_hostname))
                .setHint(getString(R.string.account_hostname_required_hint));
        ((EditText) v.findViewById(R.id.repository_description))
                .setHint(getString(R.string.account_description_optional_hint));
        sw.setContentDescription(getString(R.string.account_https_on_hint));
        portForm.setHint(getString(R.string.account_port_hint));
        ((EditText) v.findViewById(R.id.repository_servicedocument))
                .setHint(getString(R.string.account_servicedocument_hint));
    }

    return v;
}