Image for button 500x500.
I have created an ImageButton and when ImageButton is clicked the system camera should launch and the image brought from the system's camera app will be shown in the ImageView. But, the problem is: the button doesn't work here. Other than button if I click anywhere in the app the system camera launches but in case of button click the camera doesn't launch. What kind of error is causing this unexpected behaviour?
Java File:
public class Home extends AppCompatActivity {
static final int REQUEST_IMAGE_CAPTURE = 1;
ImageView imageView;
#Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
// CAMERA BUTTON IMPLEMENTATION
ImageButton cameraButton = (ImageButton)findViewById(R.id.imageButton);
imageView = (ImageView)findViewById(R.id.imageView);
/* Disable the button if the user doesn't have camera */
if(!hasCamera())
cameraButton.setEnabled(false);
// CAMERA BUTTON IMPLEMENTATION
}
// Check if the user has a camera
private boolean hasCamera(){
return getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY);
}
// Launching the camera
public void launchCamera(View view){
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
//Take a picture and pass results along to onActivityResult
startActivityForResult(intent, REQUEST_IMAGE_CAPTURE);
}
// If you want to return the image taken
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data){
if(requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK){
//Get the photo
Bundle extras = data.getExtras();
Bitmap photo = (Bitmap) extras.get("data");
imageView.setImageBitmap(photo);
}
}
}
XML FILE:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin"
tools:context="com.muchmore.www.chasquido.Home"
android:background="#drawable/home_background"
android:id="#+id/home_activity"
android:onClick="launchCamera">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome User!!!"
android:id="#+id/welcome_tag"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textColor="#000"
/>
<ImageButton
android:layout_width="90dp"
android:layout_height="90dp"
android:id="#+id/imageButton"
android:background="#drawable/camera_button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView"
android:minHeight="300dp"
android:minWidth="300dp"
android:layout_above="#+id/imageButton"
android:layout_centerHorizontal="true" />
</RelativeLayout>
You have assigned OnClickListener android:onClick="launchCamera" to your RelativeLayout (your root view) instead to your ImageButton.
Related
I don't want to alter the image I select from the gallery in any way. I just want that selected image to display as is in the ImageButton view. Because, if the image gets rotated after selecting it from the phone storage, it gets uploaded to the database in the same state and also gets fetched in the same (rotated) state. Some images rotate, while others don't. Hence, I'm not able to write a generalized code which nullifies the rotation of the selected image.
activity_post.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="15dp"
tools:context=".PostActivity">
<ImageButton
android:id="#+id/post_image_button"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
Part of PostActivity.java related to ImageButton
public class PostActivity extends AppCompatActivity {
private ImageButton selectCardImage;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_post);
selectCardImage = findViewById(R.id.post_image_button);
selectCardImage.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
OpenGallery();
}
});
private void OpenGallery() {
Intent galleryIntent = new Intent();
galleryIntent.setType("image/*");
galleryIntent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(galleryIntent, 1);
}
}
I want to design a listView such that when a user adds a photo, it will automatically update the listView with the name of the image and it's thumbnail. However my current attempts don't even render the image. Is it possible to dynamically set the ImageView for each cell of a listView and have it be updated when I add a new element to the Adapter?
XML for listView and add button:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context=".Photos"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="#+id/view_album_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="#style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"/>
<ListView android:layout_marginTop="?android:attr/actionBarSize"
android:id="#+id/photos_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:choiceMode="singleChoice"
android:listSelector="#android:color/darker_gray" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/add_photo_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_marginBottom="25dp"
android:layout_marginEnd="25dp"
android:clickable="true"
android:src="#drawable/plus"/>
</RelativeLayout>
Activity:
public class ViewAlbum extends AppCompatActivity {
public Album activeAlbum;
private ListView photoList;
private ArrayList<String> currentPhotos = new ArrayList<String>();
private ArrayAdapter<String> adapter;
private int currentSelected = -1;
public static final int PICK_IMAGE = 1;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.view_album);
final Context context = getApplicationContext();
Toolbar albumBar = findViewById(R.id.view_album_bar);
setSupportActionBar(albumBar);
photoList = findViewById(R.id.photos_list);
Bundle bundle = getIntent().getExtras();
String albumName = bundle.getString("album_name");
activeAlbum = Album.loadAlbum(this.getFilesDir().getPath()+"/"+albumName+".txt");
for(Photo photo: activeAlbum.photos){
ImageView thumbnail = findViewById(R.id.photo_thumbnail);
if(thumbnail == null){
System.out.println("why?");
//Don't understand why it is null, can't set image
}
currentPhotos.add(photo.name);
}
adapter = new ArrayAdapter<String>(this, R.layout.photo_cell,
R.id.photo_name,currentPhotos);
photoList.setAdapter(adapter);
photoList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
currentSelected = position;
}
});
FloatingActionButton addPhotoBtn = (FloatingActionButton)findViewById(R.id.add_photo_btn);
addPhotoBtn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE);
}
});
}
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data){
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PICK_IMAGE && resultCode == Activity.RESULT_OK
&& data != null && data.getData() != null) {
Uri uri = data.getData();
Photo newPhoto = new Photo("name", uri.getPath());
activeAlbum.photos.add(newPhoto);
activeAlbum.saveAlbum();
}
}
Each ListView Cell:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/activatedBackgroundIndicator">
<LinearLayout android:id="#+id/thumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dip"
android:layout_alignParentLeft="true"
android:layout_marginRight="5dip">
<ImageView
android:id="#+id/photo_thumbnail"
android:layout_width="106dp"
android:layout_height="77dp" />
</LinearLayout>
<TextView
android:id="#+id/photo_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
android:text="Album Name"
android:textColor="#0984e3"
android:textSize="25dip"
android:textStyle="bold"
android:typeface="sans" />
</RelativeLayout>
Firstly, I think album.photo is not the same array as the array you passed when you create the adapter (currentPhotos). So adding new Photo to album.photo does not reflect that item in the listView.
Secondly, as user dev points out, whenever you change the data you need to tell the adapter by adapter.notifyDataSetChanged(). However in your case, you always add to the end i think it is better to call adapter.notifyDataInserted(currentPhotos.size() - 1)
When you get result on OnActivityResult() add it to currentPhotos,
then call notifyDataSetChanged()
If you are working with images which are locally stored or on the web. Using a lib like implementation 'com.squareup.picasso:picasso:2.71828' is probably a good idea as it can handle image and URL based exception and had a catch of the data so that it is easier to open apps memory can be used minimally.
I am developing the Android app in which i want to add 2 imagview at time in layout.The flow is in layout there is one imageview added for taking photo via camera when user take photo from camera when I get the image from camera I will show it in that imageview and that imageview has one cross ImageButton on it's right corner which will get visible when image gets loaded and same thing will happen for another imageview which i want to add when user click photo but i dont know how to add this dynamically. I search for answer but there is only one imageview is added in the layout.Please help me out with this issue.
i want it like this
as show in this image the imageview has cross button on it
as per the solution given by Vijendra i updated my xml and java code but having
error
java.lang.IllegalArgumentException: Cannot add a null child view to a ViewGroup
here is my main.xml:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/bicycle_broken_layout">
<EditText
android:id="#+id/et_moreinfo_broken_bike"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="15dp"
android:hint="#string/more_info"
android:layout_marginStart="25dp"
android:layout_marginEnd="25dp"
android:background="#color/ch_bg"
android:paddingTop="5dp"
android:lines="3"
android:gravity="top|left"
android:inputType="textMultiLine"/>
<RelativeLayout
android:id="#+id/broken_image_photos"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/et_moreinfo_broken_bike"
android:layout_marginTop="20dp">
</RelativeLayout>
<Button
android:id="#+id/btn_submit_report"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/broken_image_photos"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_centerHorizontal="true"
android:background="#color/bg_main"
android:text="#string/submit_button"
android:textSize="17sp"
android:textColor="#color/white"
android:padding="15dp"/>
</RelativeLayout>
and here is mainactivity.java
public class Broken_Report_Activity extends AppCompatActivity implements
View.OnClickListener {
private EditText broken_bike_number,broken_bike_location,more_info;
private Button barcode_scanner,location;
private Button submit_report;
private CheckBox seat,pedals,breaks,lock,chain,tier;
private Imageview_add_dynamically photo1,close_photo,framlayout;
RelativeLayout broken_image_layout;
private boolean Isphoto1=false,Isphoto2=false,Isphoto3=false;
private static final int CAMERA_REQUEST = 1888;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_broken_report);
broken_bike_number = (EditText)findViewById(R.id.et_broken_bike_number);
broken_bike_location =
(EditText)findViewById(R.id.et_broken_bike_location);
more_info = (EditText)findViewById(R.id.et_moreinfo_broken_bike);
submit_report = (Button)findViewById(R.id.btn_submit_report);
seat = (CheckBox)findViewById(R.id.ch_seat);
lock = (CheckBox)findViewById(R.id.ch_lock);
chain = (CheckBox)findViewById(R.id.ch_chain);
breaks = (CheckBox)findViewById(R.id.ch_break);
pedals = (CheckBox)findViewById(R.id.ch_pedals);
tier = (CheckBox)findViewById(R.id.ch_tire);
broken_image_layout =
(RelativeLayout)findViewById(R.id.broken_image_photos);
broken_image_layout.addView(photo1);
broken_image_layout.addView(close_photo);
photo1.setOnClickListener(this);
close_photo.setOnClickListener(this);
submit_report.setOnClickListener(this);
}
#Override
public void onClick(View v) {
switch (v.getId()){
case R.id.broken_img1:
Intent broken_imag_1 = new
Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(broken_imag_1,CAMERA_REQUEST);
break;
case R.id.broken_img1_close:
broken_image_layout.removeView(photo1);
broken_image_layout.removeView(close_photo);
break;
case R.id.btn_submit_report:
break;
}
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent
data) {
super.onActivityResult(requestCode,resultCode,data);
if(requestCode == CAMERA_REQUEST && resultCode == RESULT_OK){
Bitmap photo = (Bitmap)data.getExtras().get("data");
photo1.getImgPhoto().setImageBitmap(photo);
}
}
In Your xml
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/multipleimages"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
//add your imageview here programatically
</LinearLayout>
</HorizontalScrollView>
In Java code
LinearLayout ll = (LinearLayout) findViewById(R.id.multipleimages);
ImageView imageView1=//your image 1
ImageView imageView2=//your image 2
ll.addView(imageView1);
ll.addView(imageView2);
I would appreciate some help, I want to take three photos under the same Intent with startActivityForResults() within a loop, and getting back onActivityResult () which prints those three photos in three imageviews, with MarshMallow, and its specific permissions (I think this is not the issue and it should be solved in my code),
The issue is that the application takes those three pictures, and makes the ArrayList or URIs, but it does not arrive to actually printing those three photos in the three imageviews,
Here is my code, thanks in advance,
-----------------
MainActivity.java
-----------------
public class MainActivity extends AppCompatActivity {
//private int numFotos = 1;
//private Bitmap bitmap;
private ArrayList <Uri> uriFiles;
private ImageView imageView1, imageView2,imageView3;
private Button button_takePics;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button_takePics = (Button) findViewById(R.id.Butt_tiraFotos);
imageView1 = (ImageView) findViewById(R.id.image_1);
imageView2 = (ImageView) findViewById(R.id.image_2);
imageView3 = (ImageView) findViewById(R.id.image_3);
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
!= PackageManager.PERMISSION_GRANTED) {
button_takePics.setEnabled(false);
ActivityCompat.requestPermissions(this, new String[]
{ Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE }, 0);
}
}
#Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == 0) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED
&& grantResults[1] == PackageManager.PERMISSION_GRANTED) {
button_takePics.setEnabled(true);
}
}
}
public void takePictures(View view){
uriFiles = new ArrayList<>();
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
for (int i=1; i<4; i++){
uriFiles.add(Uri.fromFile(getOutputMediaFile()));
intent.putParcelableArrayListExtra(MediaStore.EXTRA_OUTPUT,uriFiles);
startActivityForResult(intent, 100);
}
}
private static File getOutputMediaFile() {
File mediaStorageDir=null;
File formattedFile = null;
mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES), "CameraDemo");
if (!mediaStorageDir.exists()){
if (!mediaStorageDir.mkdirs()){
Log.d("CameraDemo", "failed to create directory");
return null;
}
}
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
formattedFile= new File(mediaStorageDir.getPath() + File.separator +
"IMG_"+ timeStamp + ".jpg");
return formattedFile;
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 100) {
if (resultCode == RESULT_OK) {
uriFiles = data.getParcelableArrayListExtra(MediaStore.EXTRA_OUTPUT);
// AQUI EMPIEZA EL PROBLEMA ////////
imageView1.setImageURI(uriFiles.get(0));
imageView2.setImageURI(uriFiles.get(1));
imageView3.setImageURI(uriFiles.get(2));
}
}
}
}
-------------------
activity_main.xml
-------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="com.example.faustocheca.photochooseshare.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="18dp"
android:layout_marginTop="18dp"
android:textSize="18sp"
android:text="Tira, escoge y comparte Fotos" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:hint="Tira 3 Fotos"
android:id="#+id/Butt_tiraFotos"
android:onClick="takePictures"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="48dp"
android:orientation="horizontal"
>
<ImageView
android:id="#+id/image_1"
android:layout_weight="1"
android:layout_width="80dp"
android:layout_height="120dp"
android:layout_margin="1dp"
android:background="#feafea"/>
<ImageView
android:id="#+id/image_2"
android:layout_weight="1"
android:layout_width="80dp"
android:layout_height="120dp"
android:layout_margin="1dp"
android:background="#feafea"/>
<ImageView
android:id="#+id/image_3"
android:layout_weight="1"
android:layout_width="80dp"
android:layout_height="120dp"
android:layout_margin="1dp"
android:background="#feafea"/>
</LinearLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:hint="Comparte"
android:id="#+id/Butt_comparte"
/>
</LinearLayout>
This will not work; a single startActivityForResult will result in a single call to onActivityResult.
There's no contract in the ACTION_IMAGE_CAPTURE documentation or elsewhere in the system that says that you can issue it multiple times and get one result with 3 URIs.
You'll have to loop it so that you fire one intent, wait for the result, fire the second intent, wait for the result, etc.
You may be able to fire the 3 intents in a loop like this, but I'm not sure I'd trust that the responding camera application would actually be invoked 3 times. But even so, you'll receive 3 separate onActivityResult calls, if that works.
I am developing an app in which user will take Picture from camera and display it on preview screen having image view.
**CameraCapture.java**
class ButtonClickHandler implements View.OnClickListener
{
public void onClick( View view ){
myVib.vibrate(50);
startCameraActivity();
}
}
protected void startCameraActivity()
{
File filenew = new File( _path );
Uri outputFileUri = Uri.fromFile( filenew );
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );
intent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri );
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivityForResult( intent, 0 );
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
switch( resultCode )
{
case 0:
break;
case -1:
//pictaken++;
onPhotoTaken();
break;
}
}
protected void onPhotoTaken()
{
//pictaken=true;
Intent i = new Intent(CameraCapture.this,Preview.class);
startActivity(i);
}
In my Preview class the captured picture is displayed on ImageView
**Preview.java**
File imgFile = new File("/sdcard/DCIM/Camera/test.jpg");
if(imgFile.exists()){
// Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
ImageView myImage = (ImageView) findViewById(R.id.image);
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
Matrix mat = new Matrix();
String degree="90";
mat.postRotate(Integer.parseInt(degree));
Bitmap bMapRotate = Bitmap.createBitmap(myBitmap, 0, 0,myBitmap.getWidth(),myBitmap.getHeight(), mat, true);
myImage.setImageBitmap(bMapRotate);
//myImage.setImageBitmap(myBitmap);
}
_image = ( ImageView ) findViewById( R.id.image );
Is there is any way to show progress bar on the ImageView till it load the Captured image from SD card.
Thnx in advance :)
Put your ImageView and Progressbar in a RelativeLayout. For your ProgressBar, use:
android:layout_centerInParent="true"
Which will center it in the RelativeLayout, meaning over the ImageView. You might also want to hide the ProgressBar when the image has loaded:
progressBar.setVisibility(View.Gone)
when the image has been loaded.
Sample code:
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"/>
<ProgressBar
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="visible"/>
</RelativeLayout>
This is my solution. It is a little bit different. You can use it to create intro view with an image and progress bar. Here, progress bar is at 150dp to the bottom of center. FrameLayout can also be used.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="#string/intro_description"
android:scaleType="fitXY"
android:src="#drawable/intro" />
<ProgressBar
android:id="#+id/progress"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="150dp"
android:visibility="visible" />
</FrameLayout>