i want to create wallpaper app.
i want user click image show whole image and visible set wallpaper button.
like this pictures
after licked like this
The problem is to show set wallpaper button when image clicked and show whole image.
Thank you!
to display all image display activity use recyclerview with GridLayoutManagerlike this
private GridLayoutManager lLayout;
lLayout = new GridLayoutManager(MainActivity.this, 2);
recyclerview.setLayoutManager(lLayout);
check this link for how to use recyclerview with GridLayoutManager
for display image create a new activity and pass the image when user select image from recyclerview to that activity and display
Ask me in case of any query
Related
In my application I need to show a sheet dialog sliding from top of the whole screen. Now I have a problem, my sheet dialog is showing but under status bar.
Actually view of top sheet dialog
My target is to make a background of status bar the same as sheet dialog (purple) and normally have a clock, battery status etc.
My code:
final Dialog dialog = new Dialog(MainAccountView.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.sheet_short_settings);
dialog.show();
dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.getWindow().getAttributes().windowAnimations =
R.style.TopSheet_DialogAnimation;
dialog.getWindow().setGravity(Gravity.TOP);
I tried on few devices so problem is on the code. XML layout for sheet_short_settings starting on the top of whole screen. When I turn on a "Show system UI" the status bar have a background of my layout, but have the dark transparent color.
Thanks in advance
I am using jitsi-android-sdk in which when I go click home screen it takes me to the picture in picture mode and when I click on the app takes me back to the first form page. How should full screen the picture in picture mode when I click on the app?
what should I put in onResume() so I can full-screen picture in picture on click of the app.
For example, When we are using Netflix and watching a movie on mobile when we press the home button it enters the picture in picture mode and when we click on the app icon it fullscreen the picture in picture mode (return to the movie in fullscreen which we are watching)
I want to implement the same behavior in my android app.
The first check which activity is going to paused state when the app goes picture in picture on that activity onResume() method add this code.
#Override
protected void onResume() {
super.onResume();
SharedPreferences sharedpreferences = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
//get boolean value from shared preferences which we are store when joining meeting button is clicked
boolean check = sharedpreferences.getBoolean(met,false);
if (check){
//if meeting is going on redirect to meeting
//Replace JitsiMeetAcitvity.class with your picture in picture activity class
startActivity(new Intent(this, JitsiMeetActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT));
}
}
I have used the shared preferences to keep the track of the meeting is going on or not.
If you want to see in detail Follow this
I am trying to show a full screen alert dialog like the one on the material design website: Full Screen Material Alert Dialog
I created a
new MaterialAlertDialogBuilder(this)
.setTitle("Title")
.setMessage("Message")
.setPositiveButton("Yes", null)
.show();
which works perfectly. However I want the dialog to appear as full screen with the toolbar and x button, so I can place EditTexts inside the dialog.
I tried using the other constructor MaterialAlertDialogBuilder(context, theme) but I cannot find a theme that will make the dialog appearance full screen. Is there a theme that makes the dialog full screen or do I have to do something else to make it full screen?
try this
MaterialAlertDialogBuilder dialog = new MaterialAlertDialogBuilder(this, android.R.style.Theme_DeviceDefault_NoActionBar_Fullscreen);
I want to show selected images from gallery with gridview.
But, all the tutorial is just get image from project file..
like this..
// Keep all Images in array
public Integer[] mThumbIds = {
R.drawable.pic_1, R.drawable.pic_2,
};
I coded like there is add button, if users click it,
user can save name and photo. And if they save it, shows the photo with gridview..
those data would save in sqlite db.
How can I show the image from sqlite?
I'm currently doing a Widget in Android. It is on the market and it's free.
I want to surprise the users by let them choose a picture they want to show in the widget.
Now...
If the widget is clicked, a PreferenceActivity appears. <-- Works!
In this Activity the user should be able to choose a picture from the phone picture gallery. <-- HOWTO?
After the User selected the prefered picture, the picture path or the drawable object should be stored in the SharedPreferences. <-- Would be really nice!
Is there any solution?
Thx!
In order to get an image from the Gallery, you must send an intent to start up the Gallery for the user to choose an image as such
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, 10);
This will start the gallery and will call onActivityResult within your activity.