Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

material design implement full screen dialog android java

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay"/>

</android.support.design.widget.AppBarLayout>

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffffff"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Your content here"/>

</LinearLayout>

</android.support.design.widget.CoordinatorLayout>
Comment

material design implement full screen dialog android java

public class AKDialogFragment extends DialogFragment {

private static final String TAG = "AKDialogFragment";

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

    View rootView = inflater.inflate(R.layout.dialog_ak, container, false);

    Toolbar toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
    toolbar.setTitle("Dialog title");

    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);

    ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeButtonEnabled(true);
        actionBar.setHomeAsUpIndicator(android.R.drawable.ic_menu_close_clear_cancel);
    }
    setHasOptionsMenu(true);
    return rootView;
}

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    return dialog;
}

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    menu.clear();
    getActivity().getMenuInflater().inflate(R.menu.menu_ak, menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();

    if (id == R.id.action_save) {
        // handle confirmation button click here
        return true;
    } else if (id == android.R.id.home) {
        // handle close button click here
        dismiss();
        return true;
    }

    return super.onOptionsItemSelected(item);
}
}
Comment

PREVIOUS NEXT
Code Example
Java :: how to convert string to space separated int in java 
Java :: how to convert a jsonobject to a dbobject 
Java :: illmatic 
Java :: set bean properties 
Java :: how to use set ForceDarkAllowed(false); in android studio 
Java :: java virtual override 
Java :: android code get arrayList index 
Java :: ein wort in buchstaben zerlegen java 
Java :: what is serialization in rest assured 
Java :: crazy error 
Java :: convert boolean list to primitive java 
Java :: java.lang.noclassdeffounderror: failed resolution of: lorg/apache/http/protocolversion; 
Java :: java jpanel popup message 
Java :: java schleifendurchläufe zählen 
Java :: Java Remove EnumSet Elements 
Java :: Custom Layout to listview 
Java :: Eclipse find/replace pluggin 
Java :: JVM signatures 
Java :: Java program pattern program to triangle using 100 numbers 
Java :: how to fetch email and get there body content in spring boot 
Java :: RecyclerView scrolled UP/DOWN listener 
Java :: change the default port in spring boot codegrepper 
Java :: Java Overloading by changing the number of parameters 
Java :: Java labeled break Statement 
Java :: java how to make a recrussive boolean function 
Java :: spring environment null pointer exception 
Java :: java how to make a 2d eclipse 
Java :: index out of bounds exception java 
Java :: venatana emergente con texto java 
Java :: Java double Keyword 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =