Custom Fragment is dimmed
See original GitHub issueAppIntro Version: 4.1.0
Device/Android Version: Android 6.1, 5.1
Issue details / Repro steps / Use case background: I was trying to add a custom fragment instead of using the default AppIntroFragment. I can add the custom fragment, but the entire screen is dimmed.
Your Code: Custom Fragment:
public class CustomTutorialFragment extends Fragment {
private static final String ARG_LAYOUT_RES_ID = "layoutResId";
private int layoutResId;
public static CustomTutorialFragment newInstance(int layoutResId) {
CustomTutorialFragment sampleSlide = new CustomTutorialFragment();
Bundle args = new Bundle();
args.putInt(ARG_LAYOUT_RES_ID, layoutResId);
sampleSlide.setArguments(args);
return sampleSlide;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null && getArguments().containsKey(ARG_LAYOUT_RES_ID)) {
layoutResId = getArguments().getInt(ARG_LAYOUT_RES_ID);
}
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
return inflater.inflate(layoutResId, container, false);
}
}
Custom Fragment Layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<ImageView
android:id="@+id/tutorial_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="80dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:src="@drawable/update_icon"
android:layout_gravity="center_horizontal"/>
<TextView
android:id="@+id/tutorial_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:paddingLeft="64dp"
android:paddingRight="64dp"
android:paddingTop="64dp"
android:textSize="16sp"
android:text="bla bla bla"/>
</LinearLayout>
Tutorial Activity:
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.ColorRes;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import com.github.paolorotolo.appintro.AppIntro;
import com.github.paolorotolo.appintro.AppIntroFragment;
public class TutorialSlidePageActivity extends AppIntro {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addSlide(CustomTutorialFragment.newInstance(R.layout.tutorial_fragment));
addSlide(CustomTutorialFragment.newInstance(R.layout.tutorial_fragment));
}
@Override
public void onSkipPressed(Fragment currentFragment) {
super.onSkipPressed(currentFragment);
}
@Override
public void onDonePressed(Fragment currentFragment) {
super.onDonePressed(currentFragment);
}
@Override
public void onSlideChanged(@Nullable Fragment oldFragment, @Nullable Fragment newFragment) {
super.onSlideChanged(oldFragment, newFragment);
}
Stack trace / LogCat: No errors
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
DialogFragment with clear background (not dimmed)
I'm trying to get the background of a DialogFragment to be completely clear. With setting the ...
Read more >Custom Fragment is dimmed · Issue #360 · AppIntro ... - GitHub
Issue details / Repro steps / Use case background: I was trying to add a custom fragment instead of using the default AppIntroFragment....
Read more >Displaying dialogs with DialogFragment - Android Developers
A DialogFragment is a special fragment subclass that is designed for ... you need to perform any custom logic when your Dialog is...
Read more >Fragment transaction custom animations have wrong z ordering
When setting a custom transition on a support v22 fragment transaction to ... which produces an brief dimming effect as the view's alpha...
Read more >How to stream XML fragments from an XmlReader - LINQ to ...
You can stream XML fragments from an XmlReader using a custom axis method in C# and Visual Basic. This is an approach that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OMG I’m impressed with the fast response. I was settling into the wait for a response which I thought could take weeks. Thank you so much for your help. Adding a background color did fix the issue. I dissected the custom layouts you had in your example app, but I knew I was overlooking something, Thank you so much again 😃 I will mark the issue as closed. Have a nice Thanksgiving.
@marlene89 I just happened to be on my computer when I got the email…no worries 😃 Glad your issue is solved.