Giter VIP home page Giter VIP logo

android-slidingactivity's Introduction

Android Sliding Activity Library

Preview Preview Landscape Preview Inbox Animation

Easily create activities that can slide vertically on the screen and fit well into the Material Design age.

Features

Sliding activities allow for you to easily set header content, menus, and data onto a slidable screen. The library currently supports a variety of custom features that allow you to make the screen unique. Currently support are the following:

  • Set the title and have this title shrink into the toolbar as you scroll
  • Set a header image that disappears into the toolbar as you scroll
  • Set colors that will affect the header and status bar color
  • Add a floating action button to the bottom of the header that will animate and show/hide itself at the correct time
  • Disable the header and show only content that is scrollable
  • Works with PeekView out of the box, to provide a "3D Touch" effect on your views. See example usage in the TalonActivity sample.

Preview Talon/PeekView

Installation

Include the following in your gradle script:

dependencies {
    compile 'com.klinkerapps:sliding-activity:1.5.2'
}

and resync the project.

Example Usage

Sliding activities are very easy to implement. Here is a simple example:

public class NormalActivity extends SlidingActivity {

    @Override
    public void init(Bundle savedInstanceState) {
        setTitle("Activity Title");

        setPrimaryColors(
                getResources().getColor(R.color.primary_color),
                getResources().getColor(R.color.primary_color_dark)
        );

        setContent(R.layout.activity_content);
    }
}

This will create an activity with the given title, the primary colors, and whatever is included in the activity_content layout.

You also need to reference the activity into your AndroidManifest.xml:

<activity
    android:name=".NormalActivity"
    android:excludeFromRecents="true"
    android:taskAffinity=""
    android:theme="@style/Theme.Sliding.Light"/>

More Details: First, extend SlidingActivity. Instead of overriding onCreate(), instead override init() and set all of your options for the app there. These options include:

  • setTitle()
  • setImage()
  • setContent()
  • setPrimaryColors()
  • setFab()
  • disableHeader()
  • enableFullscreen()

More examples of possible activities can be found in the sample application and code snippets will be shown below.

You can configure the scroller before it's initialised by overriding configureScroller(scroller)

@Override
    protected void configureScroller(MultiShrinkScroller scroller) {
        super.configureScroller(scroller);
        scroller.setIntermediateHeaderHeightRatio(1);
    }

Activity Options

Most activity options should be implemented inside init(). You can implement setImage() anywhere after init(), but none of the others should be outside of this method.

setTitle()

Setting the title so that it fades into the toolbar as the scrolling occurs is very easy. You can either do:

setTitle(R.string.title);

or

setTitle("Activity Title");

setImage()

You can either set a drawable resource id or a bitmap as the image:

setImage(R.drawable.header_image);
setImage(mBitmap);

When setting the image for the image, there are two options:

  1. Set it inside init()
  2. Set it outside init()

Both of these have very different functionality, so it is important to understand the difference.

If you have a drawable included in your project or already have a bitmap loaded in memory, then it would be best to set the image inside of init(). This will cause the activity colors to change based off of the image and it will show the image when the activity is scrolling up from the bottom.

If you need to load the image from a url or memory, you should not do this on the main thread. This means you need to set it after you've already initialized the activity. When doing this, the image will be animated in with a circular reveal animation (for lollipop+ users) or a fade in animation. Also, the activity will not look at the image and extract colors from it. It will instead use whatever colors you've set as your primary colors.

setContent()

Setting content is handled the same way as setting content in a normal activity. You can either pass a layout resource id or a View:

setContent(R.layout.activity_layout);
setContent(mView);

After you have set the content, it will be available with findViewById(), same as it would with a normal activity.

setPrimaryColors()

The primary color will be used to color the header when no image is present and the primary color dark will be used to color the status bar when the activity has been scrolled all the way to the top of the screen.

setPrimaryColors(primaryColor, primaryColorDark);

One thing to note here, setting an image inside of init() will override these colors. If you wish to continue specifying your own custom colors instead of using the image's extracted colors, call setPrimaryColors() AFTER setImage().

setFab()

A floating action button can be shown at the bottom of the expanded toolbar and acted on if you need that for your activity.

setFab(mBackgroundColor, R.drawable.fab_image, onClickListener);

When the user scrolls and the header begins to shrink, the FAB will be hidden from view. When the header has returned to its original size, the FAB will be shown again.

disableHeader()

If you would like to not show the header on the screen and only have your scrolling content animate up, you can call disableHeader() inside init().

enableFullscreen()

If you would like to not have the scrolling content animate up onto the screen and leave a little bit of extra room at the top, you can call enableFullscreen() inside init(). After doing this, the activity can still be slid down to dismiss it.

expandFromPoints(int,int,int,int)

This property creates an Inbox style expansion from anywhere on the screen. As with many methods, the parameters are left offset, top offset, width, and height, which describe the size of the box that you want to expand from.

Intent intent = getIntent();
if (intent.getBooleanExtra(SampleActivity.ARG_USE_EXPANSION, false)) {
    expandFromPoints(
            intent.getIntExtra(SampleActivity.ARG_EXPANSION_LEFT_OFFSET, 0),
            intent.getIntExtra(SampleActivity.ARG_EXPANSION_TOP_OFFSET, 0),
            intent.getIntExtra(SampleActivity.ARG_EXPANSION_VIEW_WIDTH, 0),
            intent.getIntExtra(SampleActivity.ARG_EXPANSION_VIEW_HEIGHT, 0)
    );
}

My suggestion: in the SampleActivity.addExpansionArgs(Intent) function, you can see that I pass the expansion parameters as extras on the intent. I would recommend using this method to pass the view from the activity under the SlidingActivity, to the SlidingActivity.

Theming

Two themes are included with the library that are specifically created for a SlidingActivity. You can use either Theme.Sliding or Theme.Sliding.Light when registering your sliding activity in the AndroidManifest.xml file. You can also use these themes as a parent to your own custom themes and use those instead if you would like.

Current Apps Using Sliding Activities

If you're using the library and want to be included in the list, email me at [email protected] and I'll get your app added to the list!

APK Download

If you'd like to check out the sample app first, you can download an APK here.

YouTube

Much higher quality than the GIFs above and more options shown: https://www.youtube.com/watch?v=fWcmy7q09aM

Contributing

Please fork this repository and contribute back using pull requests. Features can be requested using issues. All code, comments, and critiques are appreciated.

Changelog

The full changelog for the library can be found here.

Credits

Credit to the good folks who work on Android. In the contacts app on Lollipop, there is a quick contact activity that was the base implementation for this library. Check it out here.

License

Copyright (C) 2016 Jacob Klinker

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

android-slidingactivity's People

Contributors

7293hq avatar dzgeorgy avatar klinker24 avatar klinker41 avatar passsy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-slidingactivity's Issues

WebView inside FabActivity

I've a webview inside the sliding activity, Initially I had height problems, since the height isn't fixed as I've set the height and width of webview to fill_parent in xml
I used the code below to solve this,

private void setupWebView() {
    webView = (WebView) findViewById(R.id.webview);
    webView.loadUrl(mAsset);
    webView.setWebViewClient(new WebViewClient() {
        @Override
        public void onPageFinished(WebView view, String url) {
            final int height = webView.getMeasuredHeight();
            webView.setMinimumHeight(height);
            super.onPageFinished(view, url);
        }
    });
}

Note: I'm using offline html files for the webview

This solution works perfectly. but sometimes when the activity is called, the webview isn't scrollable this happens only sometimes and I wanna avoid it, Please help me with this

PS: I have ads in the page too, it mostly happens when the ads are being loaded at activity call
When no ads are downloaded everything runs smooth

About version problem

I use the latest version of the source code is 1.2.0

And in the ReadMe.md 1.1.1 or written, whether you need to update ReadMe.md?

Disable scroll on WebView

Can't not scroll content on WebView

public void init(Bundle bundle) {
    disableHeader();
    setPrimaryColors(getResources().getColor(R.color.app_theme), getResources().getColor(R.color.app_theme));
    mWebView = new WebView(this);
    WebSettings settings = mWebView.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setUseWideViewPort(true);
    settings.setSupportZoom(false);
    settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
    settings.setBuiltInZoomControls(false);
    settings.setDomStorageEnabled(true);
    settings.setLoadWithOverviewMode(true);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
        mWebView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        mWebView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING);
    } else {
        mWebView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
    }
    mWebView.setVerticalScrollBarEnabled(true);
            mWebView.loadUrl("http://weixin.qq.com/agreement?lang=zh_CN");

    setContent(mWebView);
}

Cannot set 'scaleX' to Float.NaN

Im using the latest android studio version and gradle and this exception happened.

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.tajos.iccnotes, PID: 28374
java.lang.IllegalArgumentException: Cannot set 'scaleX' to Float.NaN
at android.view.View.sanitizeFloatPropertyValue(View.java:18167)
at android.view.View.sanitizeFloatPropertyValue(View.java:18141)
at android.view.View.setScaleX(View.java:17494)
at com.klinker.android.sliding.MultiShrinkScroller.updateHeaderTextSizeAndMargin(MultiShrinkScroller.java:1304)
at com.klinker.android.sliding.MultiShrinkScroller.setHeaderHeight(MultiShrinkScroller.java:974)
at com.klinker.android.sliding.MultiShrinkScroller$8.run(MultiShrinkScroller.java:372)
at com.klinker.android.sliding.SchedulingUtils$1.onPreDraw(SchedulingUtils.java:39)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1102)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3310)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2200)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8999)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:996)
at android.view.Choreographer.doCallbacks(Choreographer.java:794)
at android.view.Choreographer.doFrame(Choreographer.java:729)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:981)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7814)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)

Listview does not scroll

Hi, i used your library and added a listview as the root element of the activity. However the listview would not scroll. Please can you help?

set height

Could I change the height of it ? Thanks.

Doesn't slide in when using setImage

Heey guys,

Im using this awesome library but whenever I use setImage the activity is not sliding in. Does somebody know how to solve this?
screenrecorder

Thanks

Best way to remove image

Hello,
what's the best way to remove an image after you've set it using setImage(...) ?

Using setImage(null) throws java.lang.RuntimeException: [...] java.lang.IllegalArgumentException: Bitmap is not valid

Use RecyclerView

When I'm trying to use a RecyclerView inside a SlidingActivity I get this error:

     Caused by: java.lang.ClassNotFoundException: android.view.RecyclerView
       at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
       at android.view.LayoutInflater.createView(LayoutInflater.java:552)
       at android.view.LayoutInflater.onCreateView(LayoutInflater.java:643)

I added library project to my project and I tried adding recyclerview gradle dependency but I get the same error.
how can I fix it?

setTypeface to title?

Hi, thanks for this beautiful library :)
would you please tell me how change typeface on title?
and is it possible to disable/enable swipe down to close programmatically?

thanks in advance...

problem with google play service

It has problem with google play service
when I add google play service in gradle and run the project it makes this runtime error:

        Could not find class 'android.support.v7.internal.view.menu.MenuBuilder', referenced from method android.support.v7.app.AppCompatDelegateImplV7.initializePanelMenu
        Could not find class 'android.support.v7.internal.view.menu.MenuBuilder', referenced from method android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.onCreatePanelMenu
        Could not find class 'android.support.v7.internal.view.menu.MenuBuilder', referenced from method android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.onPreparePanel

why is that?

Protected final on onNewIntent

Very nice library. I just wondering is it possible to remove the final on onNewIntent method ? My app need to use this method to work properly. Or is there any workaround with this lib ?

Many thanks.

Recycler view is not scrolling inside the Sliding Activity

I have added a fragment inside my SlidingActivity. Inside the fragment, there is a RecyclerView.
Now the recycler view is not scrolling inside the sliding activity but if I add this fragment to an AppCompatActivity, then the scrolling is working fine.

Cannot start this animator on a detached view

When I open the activity from a RecyclerView works ok, but when I open it again with the same image drops an IllegalStateException. I add the Logcat:

 Caused by: java.lang.IllegalStateException: Cannot start this animator on a detached view!
at android.view.RenderNode.addAnimator(RenderNode.java:817)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:300)
at android.view.RenderNodeAnimator.setTarget(RenderNodeAnimator.java:282)
at android.animation.RevealAnimator.<init>(RevealAnimator.java:37)
at android.view.ViewAnimationUtils.createCircularReveal(ViewAnimationUtils.java:53)
at com.klinker.android.sliding.SlidingActivity.setImage(SlidingActivity.java:345)
at com.vvss.noticiasanime.DetailNewDark$2$override.onResourceReady(DetailNewDark.java:129)
at com.vvss.noticiasanime.DetailNewDark$2$override.access$dispatch(DetailNewDark.java)
at com.vvss.noticiasanime.DetailNewDark$2.onResourceReady(DetailNewDark.java:0)
at com.vvss.noticiasanime.DetailNewDark$2.onResourceReady(DetailNewDark.java:126)
at com.bumptech.glide.request.GenericRequest.onResourceReady(GenericRequest.java:525)

I add my code:

target = new SimpleTarget<Bitmap>() {
            @Override
            public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                setImage(resource);           
            }
        };

Seems that the problem is in the setImage() :

public void setImage(Bitmap bitmap) {

        photoView.setImageBitmap(bitmap);

        if (isStarting) {
            Palette palette = Palette.from(bitmap).generate();
            setPrimaryColors(palette.getVibrantColor(DEFAULT_PRIMARY_COLOR),
                    palette.getDarkVibrantColor(DEFAULT_PRIMARY_DARK_COLOR));
        } else {
            photoViewTempBackground.setBackgroundDrawable(photoView.getBackground());
            photoViewTempBackground.setVisibility(View.VISIBLE);

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                final int cx = (int) photoView.getX() + photoView.getMeasuredWidth() / 2;
                final int cy = (int) photoView.getY() + photoView.getMeasuredHeight() / 2;
                final int finalRadius = photoView.getWidth();


                Animator anim = ViewAnimationUtils.createCircularReveal(photoView, cx, cy,
                        0, finalRadius);
                anim.setDuration(500);
                anim.addListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        super.onAnimationEnd(animation);
                        photoViewTempBackground.setVisibility(View.GONE);
                    }
                });
                anim.start();


            } else {
                photoView.setAlpha(0f);
                photoView.animate()
                        .alpha(1f)
                        .setListener(new AnimatorListenerAdapter() {
                            @Override
                            public void onAnimationEnd(Animator animation) {
                                super.onAnimationEnd(animation);
                                photoView.setAlpha(1f);
                                photoViewTempBackground.setVisibility(View.GONE);
                            }
                        })
                        .start();
            }
        }
    }

Specially in the line Animator anim = ViewAnimationUtils.createCircularReveal(photoView, cx, cy, 0, finalRadius);. How can I solve it? Thanks.

Translucent header, how disable?

Hello! Thanks you, for your awesome work!
I use your library and i have transperent header (+fab) :(

2015-08-31 03-19-32

How i can remove transparency from header?

My Activity have only 3 lines:
setTitle(app.getTitle());
setPrimaryColors(R.color.primary, R.color.primary_dark);
setContent(R.layout.activity_detail);

R.color.primary - not transperent :o

No option to restrict scroll height

I am using content description and below content description, I am using tabLayout. I want the behavior when user scroll up the sliding activity then it should only scroll until the tabLayout comes, once tabLayout comes at the top then I want to stop the scrolling of Sliding activity

Add apk

You should add an apk for testing so that we can try if we can use it somewhere or not.
By the way great work

Possible to customize FAB?

I would like to use one of the various "FAB progress" libraries that allow you to either wrap an existing FAB object, such as this one or use the library directly as a FAB object, such as this one.

The SlidingActivity appears to handle the lifecycle of all its views directly (which is very convenient for the most part); I do not see a way to easily customize the FAB or any other view for that matter, other than the normal setContent().

I attempted the following in init(), and it "works" in the sense that it does not crash, but it loses all the layout information of the FAB, which now appears in the top-left corner. With more work I could probably get it fairly well integrated, but it would be nicer to have a first-party solution.

        val fab = findViewById(R.id.fab)
        val fabParent = fab.parent as ViewGroup
        fabParent.removeView(fab)

        val fabWrapper = FABProgressCircle(this)
        fabWrapper.addView(fab)
        fabParent.addView(fabWrapper)

Is there a good way to use SlidingActivity with these kinds of extras?

Not able to add content xml

Hello i implemented your library in my project. The problem i am facing is :
i am not able to attach the content layout in my file.. i did everything as required but still i am not able to see the textview which is in my content_xml.

Below is my code:
Activity:

public class OtherUserProfileActivity extends SlidingActivity {

    @Override
    public void init(Bundle savedInstanceState) {
        setTitle("Profile");
        setPrimaryColors(
                getResources().getColor(R.color.primary_dark),
                getResources().getColor(R.color.primary)
        );
        setContent(R.layout.other_user_content);
        setHeaderContent(R.layout.other_user_header_content);
        setFab(
                getResources().getColor(R.color.accent),
                R.drawable.fb_like_icon,
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Toast.makeText(OtherUserProfileActivity.this, "FAB Clicked", Toast.LENGTH_SHORT).show();
                    }
                }
        );

    }

    @Override
    protected void configureScroller(MultiShrinkScroller scroller) {
        super.configureScroller(scroller);
        scroller.setIntermediateHeaderHeightRatio(1);
    }
}

other_user_content

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    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:textColor="#ffffff"
    android:text="I think Sir you can avoid the error without turning off the Proguard. " />

other_user_header_content

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:contentDescription="@string/app_name"
        android:scaleType="centerCrop"
        android:src="@drawable/background" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <com.appsfreax.bestinspirationalquotes.customImageView.widget.CircleImageView
            android:layout_width="120dp"
            android:layout_height="120dp"
            android:layout_gravity="center_horizontal"
            android:layout_marginBottom="15dp"
            android:layout_marginTop="15dp"
            android:src="@drawable/heart_on" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="My Profile"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="#ffffff" />

    </LinearLayout>
</FrameLayout>

Screenshot Attached:
screenshot_20161215-143757
screenshot_20161215-143802

Header size problem

Hi, i used your library it nice but i am facing some problem in Header part

Take ur project activity

Normal Activity which contain only TextView
MenuItemActivity which contain Two EditText and Button

In Normal activity when we scroll header size is getting decreased as we go top of device
but in MenuItemActivity it not happening

Please can u help me out in these issue

Image header size

Hi, nice library. I wanted to customize my image header size. How can I do that?

SlidingFragment Request

how much hard is converting sliding activity into sliding fragment so we could use multiple fragment withing same activity maintaining smooth use experince.

Thanks ahead ๐Ÿ‘

Illegal argument exception in scaleX

After updating android support libraries to AndroidX library crashes when starting SlidingActivity. Library crashes in MultiShrinkScroller class when passing NaN to scaleX method.
Please consider updating a library to prevent apps using your library from crashing. I try fx below and app is working just fine with this change.
try { largeTextView.setScaleX(scale); largeTextView.setScaleY(scale); } catch (IllegalArgumentException ignored) {}
Thanks.

Crash while inflating XML

java.lang.RuntimeException: Unable to start activity ComponentInfo{me.seasonyuu.douban.movie/me.seasonyuu.douban.movie.ui.ViewMovieActivity}: android.view.InflateException: Binary XML file line #51: Binary XML file line #18: Error inflating class com.klinker.android.sliding.TouchlessScrollView
             at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2760)
             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2846)
             at android.app.ActivityThread.-wrap12(ActivityThread.java)
             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1550)
             at android.os.Handler.dispatchMessage(Handler.java:102)
             at android.os.Looper.loop(Looper.java:154)
             at android.app.ActivityThread.main(ActivityThread.java:6322)
             at java.lang.reflect.Method.invoke(Native Method)
             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
          Caused by: android.view.InflateException: Binary XML file line #51: Binary XML file line #18: Error inflating class com.klinker.android.sliding.TouchlessScrollView
          Caused by: android.view.InflateException: Binary XML file line #18: Error inflating class com.klinker.android.sliding.TouchlessScrollView
          Caused by: java.lang.reflect.InvocationTargetException
             at java.lang.reflect.Constructor.newInstance0(Native Method)
             at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
             at android.view.LayoutInflater.createView(LayoutInflater.java:645)
             at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
             at android.view.LayoutInflater.parseInclude(LayoutInflater.java:964)
             at android.view.LayoutInflater.rInflate(LayoutInflater.java:854)
             at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
             at android.view.LayoutInflater.rInflate(LayoutInflater.java:861)
             at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
             at android.view.LayoutInflater.rInflate(LayoutInflater.java:861)
             at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
             at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
             at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
             at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
             at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:292)
             at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
             at com.klinker.android.sliding.SlidingActivity.onCreate(SlidingActivity.java:107)
             at android.app.Activity.performCreate(Activity.java:6760)
             at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)
             at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2713)
             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2846)
             at android.app.ActivityThread.-wrap12(ActivityThread.java)
             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1550)
             at android.os.Handler.dispatchMessage(Handler.java:102)
             at android.os.Looper.loop(Looper.java:154)
             at android.app.ActivityThread.main(ActivityThread.java:6322)
             at java.lang.reflect.Method.invoke(Native Method)
             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
          Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 13: TypedValue{t=0x2/d=0x7f03007c a=-1}
             at android.content.res.TypedArray.getDrawable(TypedArray.java:925)
             at android.view.View.<init>(View.java:4213)
             at android.view.ViewGroup.<init>(ViewGroup.java:579)
             at android.widget.FrameLayout.<init>(FrameLayout.java:92)
             at android.widget.ScrollView.<init>(ScrollView.java:184)
             at android.widget.ScrollView.<init>(ScrollView.java:180)
             at com.klinker.android.sliding.TouchlessScrollView.<init>(TouchlessScrollView.java:57)
E/AndroidRuntime:     at com.klinker.android.sliding.TouchlessScrollView.<init>(TouchlessScrollView.java:47)
                                                                               	... 29 more
compileSdkVersion 25
buildToolsVersion "25.0.3"

implementation 'com.android.support:appcompat-v7:25.4.0'

Code of Activity

class ViewMovieActivity : SlidingActivity() {

    override fun init(savedInstanceState: Bundle?) {
        setContent(R.layout.activity_view_movie)
    }
}

It doesn't work

I added this library and opened the activity in an adapter.

image

Manifest

image

Activity class

image

Which is the error?

image

Error with arrow button back

Hi, it's possible to show arrow button back in the left of the toolbar? Now is in the right, i attach a screenshot about this problem. Thanks.

screenshot_2015-12-27-14-53-07

Crash when opening SlidingActivity from Widget

This only happens when the app isn't active.
I did everything like in the ReadMe and I'm opening the activity from the widget via a PendingIntent.
Do I have to add sth special to the Intent, do I have to change something in the Manifest or what did I wrong?

Any way to minimise and activity than destroy it by swiping down?

Is there any way to utilise this library or extend it to only minimise an activity on swipe down and keep as a snackbar when swiped down? I'm talking about similar functionality to youtube app where if you swipe down while watching a video, you can view other video lists while the currently playing video is minimised but not stopped.

full screen tablet

screenshot_2016-10-25-17-06-16

this is what i got in my tablet

How to fix that to get full screen please

How to change title color manipulate with imageView of slider?

How to change title color manipulate with imageView of slider?

<style name="Theme.MyGreenTheme" parent="Theme.Sliding.Light"> <item name="android:titleTextColor">@color/colorAccent</item> </style>

Thank you for the greatest lib I ever see. Just have this question

Getting error in SlidingActiving

Caused by: android.view.InflateException: Binary XML file line #18: Error inflating class com.klinker.android.sliding.TouchlessScrollView

Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f010000 a=-1}

Set header view from Glide

Hello, Great work so far thx alot.
Is there anyway to load header image using Glide ?
Or Should I loaded to Bitmap than user setImage() ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.