-
-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show GiphyGifInfoBottomSheetFragment before the Giphy gif selector.
- Loading branch information
1 parent
cfe1781
commit e5b35e1
Showing
6 changed files
with
102 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...cilealligator/infinityforreddit/bottomsheetfragments/GiphyGifInfoBottomSheetFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package ml.docilealligator.infinityforreddit.bottomsheetfragments; | ||
|
||
import android.content.Context; | ||
import android.os.Bundle; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.giphy.sdk.ui.views.GiphyDialogFragment; | ||
|
||
import ml.docilealligator.infinityforreddit.activities.BaseActivity; | ||
import ml.docilealligator.infinityforreddit.customviews.LandscapeExpandedRoundedBottomSheetDialogFragment; | ||
import ml.docilealligator.infinityforreddit.databinding.FragmentGiphyGifInfoBottomSheetBinding; | ||
|
||
public class GiphyGifInfoBottomSheetFragment extends LandscapeExpandedRoundedBottomSheetDialogFragment { | ||
|
||
private BaseActivity activity; | ||
|
||
public GiphyGifInfoBottomSheetFragment() { | ||
// Required empty public constructor | ||
} | ||
|
||
@Override | ||
public View onCreateView(LayoutInflater inflater, ViewGroup container, | ||
Bundle savedInstanceState) { | ||
FragmentGiphyGifInfoBottomSheetBinding binding = FragmentGiphyGifInfoBottomSheetBinding.inflate(inflater, container, false); | ||
|
||
binding.selectGiphyGifButtonUploadedImagesBottomSheetFragment.setOnClickListener(view -> { | ||
GiphyDialogFragment.Companion.newInstance().show(activity.getSupportFragmentManager(), "giphy_dialog"); | ||
dismiss(); | ||
}); | ||
|
||
return binding.getRoot(); | ||
} | ||
|
||
public void onAttach(@NonNull Context context) { | ||
super.onAttach(context); | ||
this.activity = (BaseActivity) context; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions
42
app/src/main/res/layout/fragment_giphy_gif_info_bottom_sheet.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ScrollView 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" | ||
tools:context=".bottomsheetfragments.GiphyGifInfoBottomSheetFragment"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<pl.droidsonroids.gif.GifImageView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center" | ||
android:padding="16dp" | ||
android:src="@drawable/powered_by_giphy" /> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingStart="16dp" | ||
android:paddingEnd="16dp" | ||
android:text="@string/select_giphy_gif_explanation" | ||
android:fontFamily="?attr/font_family" | ||
android:textSize="?attr/font_default" | ||
android:textColor="?attr/secondaryTextColor" /> | ||
|
||
<com.google.android.material.button.MaterialButton | ||
android:id="@+id/select_giphy_gif_button_uploaded_images_bottom_sheet_fragment" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_horizontal" | ||
android:layout_margin="16dp" | ||
android:backgroundTint="@color/colorPrimary" | ||
android:textColor="#FFFFFF" | ||
android:text="@string/select_giphy_gif" /> | ||
|
||
</LinearLayout> | ||
|
||
</ScrollView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters