Question: I have a custom DialogFragment whose layout holds just a EditText element. 

Layout: 

```
<?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <EditText
        android:id="@+id/reminder"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/reminder_message"
        android:inputType="text" />
</LinearLayout>

```

Code:

```
public class ReminderDialog extends DialogFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_reminder, container, false);
        return rootView;
    }

    @Override
    public void onDismiss(DialogInterface dialog) {
        super.onDismiss(dialog);
        if (onDismissListener != null) {
        String text = (String) ((TextView) (rootView.findViewById(R.id.reminder))).getText();
        onDismissListener.onDismiss(text);
        }
    }

```

It is working fine in app module. But I want to take into library module. But then I debugged the error, it is because 
R.id.reminder is 0.

Is there anyway to access the element.

Answer: 
You can change the container width based on screen size using media query. `.container` in normal takes `width` equal to children `width`, and each children takes `width: 102px` (width + border left/right) , `.container` `width` = children width + container border;

When the screen get width smaller than `.container` width then, it will push the last element below. from this point you can set media query based on .container width.

<https://jsfiddle.net/v5czL9he/2/>

```css
* {
  margin:0;
  padding: 0;
}

.container {
  border: 1px solid red;
  display: table;
}

.content {
  border: 1px solid blue;
  width: 100px;
  height: 100px;
  float: left;
}

/* if screen width < .container width
   decrease last element from fisrt row
   decrease it's width from the container width
*/
@media only screen and ( max-width: 308px ) {
 .container {
   width: calc( 306px - 102px );
 }
}

@media only screen and ( max-width: 206px ) {
 .container {
   width: calc( 204px - 102px );
 }
}
```

```html
<div class="container">
  <div class="content"></div>
  <div class="content"></div>
  <div class="content"></div>
  <div style="clear:both"></div>
</div>
```
By adding fixed width? (if I understand correctly what you want)

```
width:305px;

```