<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/FindOptions"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/UnCollapseFindButtonPanel">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/queryText"
android:hint="Ключевое слово" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:id="@+id/UnCollapseFindButtonPanel"
android:layout_height="wrap_content">
<Button
android:text="Развернуть поиск"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/UnCollapseFindButton"
android:textColor="#ffffffff" />
</LinearLayout>
</RelativeLayout>
public void testCreateFile() throws IOException {
String path = File.separator + "tmp_test";
File DIR = null;
boolean b = false;
DIR = new File(Environment.getExternalStorageDirectory(), path);
b = DIR.mkdirs();
File file = new File(DIR, File.separator + "file.ok");
file.createNewFile();
String string = "Hello world!";
FileOutputStream outputStream;
try {
outputStream = activity.openFileOutput(file.getAbsolutePath(),Context.MODE_PRIVATE);
outputStream.write(string.getBytes());
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
File fileRes = new File(file.getAbsolutePath());
assertNotNull(file);
assertEquals(file.exists(),true);
}
<!--Обязательно в корневом Layout делаем wrap_content по width и height-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical"
android:layout_gravity="center">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="64dp"
android:background="@color/cp_yellow">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title"
android:textColor="@android:color/white"
android:textSize="22sp" />
</RelativeLayout>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center">
<ProgressBar
android:id="@android:id/progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center" />
<com.RichEditText.colorpicker.ColorPickerPalette
android:id="@id/color_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:visibility="gone" />
</FrameLayout>
</ScrollView>
</LinearLayout>
</FrameLayout>
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = LayoutInflater.from(getActivity()).inflate(R.layout.color_picker_dialog, null); // Находим наш Layout
this.mProgress = ((ProgressBar) view.findViewById(android.R.id.progress));
this.mPalette = ((ColorPickerPalette) view.findViewById(R.id.color_picker));
this.mPalette.init(this.mSize, this.mColumns, this);
if (this.mColors != null)
showPaletteView();
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); //Прячем стандартный Title
return view;
}