Code Monkey home page Code Monkey logo

android-split-pane-layout's People

Contributors

mobidevelop 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

android-split-pane-layout's Issues

Child Splits

When I move split position to up or down, child splits below also change, but child splits above is not affect ( when I move it to left or right, I got the same issue). How I can move split position but child splits is not affect?

Thanks

on resize automatic recalculation

Thanks for the library. Whenever I have the component above another view, e,g, a button, and I set visibility of the button to GONE, one of the areas takes the whole new space and assigned percentage is lost. It would be necessary a recalculation based in the assigned percentage.

I tried by doing requestLayout() on different places but no luck. Any idea how to do that?

java.lang.UnsupportedOperationException: Can't convert value at index 1 to dimension: type=0x1d

android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class com.mobidevelop.spl.widget.SplitPaneLayout
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class com.mobidevelop.spl.widget.SplitPaneLayout
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at com.ashomok.imagetotext.ocr_result.tab_fragments.TextFragment.onCreateView(TextFragment.java:63)
at android.app.Fragment.performCreateView(Fragment.java:2611)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1276)
at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2415)
at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2194)
at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2148)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2049)
at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:798)
at android.support.v13.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:151)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1236)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1084)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1614)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:714)
at android.support.design.widget.HeaderScrollingViewBehavior.onMeasureChild(HeaderScrollingViewBehavior.java:91)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onMeasureChild(AppBarLayout.java:1361)
at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:784)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
at android.view.View.measure(View.java:22002)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6580)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at com.android.internal.policy.DecorView.onMeasure(DecorView.java:721)
at android.view.View.measure(View.java:22002)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2410)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1498)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1751)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:723)
at android.view.Choreographer.doFrame(Choreographer.java:658)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 1 to dimension: type=0x1d
at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:730)
at com.mobidevelop.spl.widget.SplitPaneLayout.extractAttributes(SplitPaneLayout.java:86)
at com.mobidevelop.spl.widget.SplitPaneLayout.<init>(SplitPaneLayout.java:74)
... 63 more

Test running failed: Instrumentation run failed due to 'Process crashed.'

text_fragment.xml

<?xml version="1.0" encoding="utf-8"?>

<com.mobidevelop.spl.widget.SplitPaneLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:spl="http://schemas.android.com/apk/res-auto"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    spl:orientation="vertical"
    spl:splitterBackground="@color/colorAccent"
    spl:splitterPosition="33%"
    spl:splitterSize="12dip"
    android:id="@+id/split_pane_layout">

    <include layout="@layout/split_pane_content" />
</com.mobidevelop.spl.widget.SplitPaneLayout>

Any advices?

Adding parent layout to one child view error

Hi ,
Thanks for library. I am using tableview and mapview as child inside split pane layout .
I want to implement horizontal scrollview for tableview .If i add horizontal scrollview as parent to table view following error occuring in split pane layout. I have tried put a layout for horizontal scrollview with table view as one child and map view as another child,but same error is coming.

Sample code

<com.mobidevelop.spl.widget.SplitPaneLayout
android:id="@+id/layout_map_track"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/appBar_reprt_map"
android:visibility="visible">

    <HorizontalScrollView
        android:layout_width="wrap_content"
        android:layout_below="@+id/toolbar"
        android:layout_height="wrap_content">
    <de.codecrafters.tableview.SortableTableView
        android:id="@+id/tableView_map"
        android:layout_width="800dp"
        android:layout_height="match_parent"
        android:scrollbars="horizontal"

        />
    </HorizontalScrollView>
    <fragment
        android:id="@+id/map"
        class="com.google.android.gms.maps.SupportMapFragment"

        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</com.mobidevelop.spl.widget.SplitPaneLayout>

Error
java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams
at android.widget.FrameLayout.onMeasure(FrameLayout.java:224)
at android.widget.HorizontalScrollView.onMeasure(HorizontalScrollView.java:315)
at android.view.View.measure(View.java:19169)
at com.mobidevelop.spl.widget.SplitPaneLayout.onMeasure(SplitPaneLayout.java:160)
at android.view.View.measure(View.java:19169)

Is this usable within a fragment?

Hi, there.

Experimenting a bit with this layout, using it as the parent element of a fragment crashes the app in runtime... With no error message at all in the debugging window in Android Studio. The error occurs in the onCreateView fragment event, when the "inflate" method is invoked.

I'm using kotlin, Android Studio 3.3, androidx, gradle 3.3... Also, on kotlin, a SplitPaneLayout object... There's some kind of issue with "onSplitterPositionChangedListener"... Can't be resolved...

Any idea?

Ability to set min / max position

Right now you can get the splitter into an odd state where it is not visible on screen. It would be nice to have some attributes setting a minimum and maximum split % just like you have for the initial split % stopping the user from getting into this situation and allowing more control over the splitter.

Add a setter for orientation

Right now, the only way to set the orientation is via the XML attribute, which limits SplitPaneLayout's use when dynamically constructed. Adding a getter/setter pair for orientation would parallel the other options that can be set via attributes or setters.

Thanks!

Could not find method runProGuard()

Error:(16, 0) Could not find method runProguard() for arguments [false] on BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}} of type com.android.build.gradle.internal.dsl.BuildType.

Downloadable APK crashes on startup

Environment: Nexus 10, Android 4.2.2

Steps to Reproduce: Install app from barcode, then run

Expected Results: a really cool split-pane layout demo :-)

Actual Results: crash, with the following stack trace

04-11 18:26:31.962: E/AndroidRuntime(5048): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mobidevelop.widget/com.mobidevelop.widget.Demo}: java.lang.ClassNotFoundException: Didn't find class "com.mobidevelop.widget.Demo" on path: /data/app/com.mobidevelop.widget-1.apk
04-11 18:26:31.962: E/AndroidRuntime(5048):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at android.os.Looper.loop(Looper.java:137)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at android.app.ActivityThread.main(ActivityThread.java:5041)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at java.lang.reflect.Method.invokeNative(Native Method)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at java.lang.reflect.Method.invoke(Method.java:511)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at dalvik.system.NativeStart.main(Native Method)
04-11 18:26:31.962: E/AndroidRuntime(5048): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mobidevelop.widget.Demo" on path: /data/app/com.mobidevelop.widget-1.apk
04-11 18:26:31.962: E/AndroidRuntime(5048):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
04-11 18:26:31.962: E/AndroidRuntime(5048):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
04-11 18:26:31.962: E/AndroidRuntime(5048):     ... 11 more

remeasure method called twice

I am calling setSplitterSize() and setSplitterPositionPercent() in our app to show and hide a Google Street View. Unfortunately both of those methods force the remeasure() method to be called which seems to cause performance issues. Here is how I hide the street view and the splitter:

       splitPaneLayout.setSplitterSize( 0 );
       splitPaneLayout.setSplitterPositionPercent( 0.0001f );

Here is the code I use to later show the street view and splitter:

        splitPaneLayout.setSplitterSize( 20 );
        splitPaneLayout.setSplitterPositionPercent( 0.5f );

The street view is initially hidden:

I did not see a way to subclass SplitPaneLayout to avoid remeasure being called twice.

prompt for a modif

I tried the APK demo, it didn't displ. anything & crashed,
then I tried to use the SplitLayoutPanel but NOT by the layout.xml way, in the Activity code...
( new SplitLayoutPanel(Context...).addView(...) )

The Panel took always more than the screen, and the splitDivider was not visible,

So I modified it :

  • I no more use the onMeasure(...),
  • and I work with only onLayout(...) and the percentage spiltValue, even in onTouch(....),
  • the pixel value is ONLY recomputed in onLayout(...) then applied to view0 & view1 LayoutParams

If you are intrested with the modif. code, let me know....

Why res/drawable-hdpi/ for your ShapeDrawables?

In the demo project, you have your <shape> files in res/drawable-hdpi/. Since <shape> drawables have no density, they are usually put in res/drawable/ -- you'll see this in the SDK resources, for example. I just tried your shapes in res/drawable/ in the project I am working on, and they seem to work fine there. Is there a reason you put them in res/drawable-hdpi/?

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.