Giter VIP home page Giter VIP logo

carbon's People

Contributors

dsteve595 avatar jakub-swierk avatar luongvo avatar zieiony 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  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

carbon's Issues

RadialTransition

Hi! Radial Transition is a sort of Custom Activity? and if i would like use it, i have to insert fragments inside it??? Thanks

NullPointerException in setBackground()

Whenever I use android:background attr, I get expection in the view's method. Tried only with CardView/LinearLayout.

App theme is carbon_Theme.AppCompat.Light

        <carbon.widget.CardView
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_margin="8dp"
        android:clickable="true"
        android:descendantFocusability="blocksDescendants"
        app:carbon_rippleColor="#42ff0000"
        app:carbon_elevation="2dp"
        app:carbon_rippleStyle="over"
        app:carbon_touchMargin="6dp"
        android:background="@drawable/pink_rect">

StackTrace:

        Caused by: java.lang.NullPointerException
        at carbon.widget.CardView.setBackground(CardView.java:98)
        at android.view.View.<init>(View.java:4025)
        at android.view.ViewGroup.<init>(ViewGroup.java:480)
        at android.widget.LinearLayout.<init>(LinearLayout.java:176)
        at android.widget.LinearLayout.<init>(LinearLayout.java:172)
        at carbon.widget.CardView.<init>(CardView.java:24)
        at java.lang.reflect.Constructor.constructNative(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at android.view.LayoutInflater.createView(LayoutInflater.java:600)

An exception is thrown either a drawable shape or just a color is set in XML

Color and elevation are not working for RelativeLayout

I can't set a background color or elevation to the cabron.widget.RelativeLayout view. It works great with the cabron.widget.LinearLayout but not with the RelativeLayout version. Do you have any suggestion for this one?

(The below view is inside a carbon.widget.RelativeLayout parent container).

 <carbon.widget.RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            app:carbon_elevation="@dimen/low_elevation"
            >

Larger shadows

Shadows are limited to 25px, which is about 8dp on modern devices. This is due to gaussian blur radius being limited to 25.

iml in souce

I don't think you need (or should put) .iml files in your version control. As long as you have the gradle file correct, intellij/android-studio should build the iml file correctly. Please add to .gitignore

java.lang.VerifyError when using carbon.widget.LinearLayout

when i open my app it's crashing with the following error:

03-06 17:35:28.452  32415-32415/de.xorg.gsapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: de.xorg.gsapp, PID: 32415
    java.lang.VerifyError: carbon/shadow/ShadowGenerator
            at carbon.widget.RelativeLayout.drawChild(RelativeLayout.java:106)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2962)
            at carbon.widget.RelativeLayout.dispatchDraw(RelativeLayout.java:89)
            at android.view.View.draw(View.java:14389)
            at android.view.ViewGroup.drawChild(ViewGroup.java:3118)
            at carbon.widget.LinearLayout.drawChild(LinearLayout.java:146)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2962)
            at carbon.widget.LinearLayout.dispatchDraw(LinearLayout.java:84)
            at android.view.View.draw(View.java:14389)
            at android.view.ViewGroup.drawChild(ViewGroup.java:3118)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2955)
            at android.view.View.draw(View.java:14389)
            at android.view.ViewGroup.drawChild(ViewGroup.java:3118)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2955)
            at android.view.View.draw(View.java:14389)
            at android.view.ViewGroup.drawChild(ViewGroup.java:3118)
            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2955)
            at android.view.View.draw(View.java:14509)
            at android.widget.FrameLayout.draw(FrameLayout.java:472)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2451)
            at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2546)
            at android.view.ViewRootImpl.draw(ViewRootImpl.java:2459)
            at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2301)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1047)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5896)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
            at android.view.Choreographer.doCallbacks(Choreographer.java:574)
            at android.view.Choreographer.doFrame(Choreographer.java:544)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5103)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
            at dalvik.system.NativeStart.main(Native Method)

Ripples are missing one important thing

Hi, thanks for this awesome library. Your implementation of ripples seems to be better than the others. However there's one thing that is missing — the ripple should be canceled as soon as the user moves his finger out of the View (this is how the Lollipop ripples work)

PagerTabStrip crashes when empty

java.lang.NullPointerException   at carbon.widget.PagerTabStrip.draw(PagerTabStrip.java:165)   at android.view.View.draw(View.java:15022)   at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3404)   at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:53)   at android.view.ViewGroup.drawChild(ViewGroup.java:3404)   at carbon.widget.LinearLayout.drawChild(LinearLayout.java:93)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)   at carbon.widget.LinearLayout.dispatchDraw(LinearLayout.java:84)   at android.view.View.draw(View.java:15017)   at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3404)   at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:53)   at android.view.ViewGroup.drawChild(ViewGroup.java:3404)   at carbon.widget.LinearLayout.drawChild(LinearLayout.java:93)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)   at carbon.widget.LinearLayout.dispatchDraw(LinearLayout.java:84)   at android.view.View.draw(View.java:15017)

Auto run animation when activity start

I have a Button like this, at the start of activity I want to have all run popup animation, but I cannot find anyway to achieve this.

< carbon.widget.Button
android:id="@+id/new_task_enter_number"
style="@style/contact_select_btn"
android:text="{fa-plus} Enter"
app:carbon_inAnimation="pop"
app:carbon_outAnimation="pop"/>

I have tried set view to Button "gone" (in both code and xml) and change to "visible" in code but no luck. Thanks in advance.

Corners in views

Layouts are drawing content really cut out by their corners, but simple views can just draw backgrounds with corners.

Support changing button background color programmatically

If, in XML, I have a button with android:background="@color/green", the button will correctly appear as a green button. However, there's no way I can see to change this from Java. CallingsetBackgroundColor` does set the color correctly, but the button changes to a plain rectangle and loses its style.

Can't enable ripple on CardView/LinearLayout

Whenever I inflate my CardView, I can't make it ripple like in sample project.
I do inherit app theme from carbon_Theme.AppCompat.Light

An example of my layout:

   <carbon.widget.LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <carbon.widget.CardView
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_margin="8dp"
        android:clickable="true"
        android:descendantFocusability="blocksDescendants"
        app:carbon_rippleColor="#42ff0000"
        app:carbon_elevation="2dp"
        app:carbon_rippleStyle="over"
        app:carbon_touchMargin="6dp">

        <carbon.widget.TextView
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="TEX TEX TEXT"
            android:textColor="@android:color/black"/>

    </carbon.widget.CardView>

    <carbon.widget.LinearLayout android:id="@+id/catalog_content"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:orientation="horizontal"/>

    <ProgressBar
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/progressBar"
        android:layout_gravity="center_horizontal" />

</carbon.widget.LinearLayout>

What's the point? How to make views act like in your sample project?

ripple on top

related to #5 as ImageView can only make use of a ripple drawn on top of an image

Ripple & Shadows are not displayed

The ripple is not displayed when I add a background color to the button & the shadows are not displayed.

    <carbon.widget.Button
        android:text="Details"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_marginRight="10dp"
        app:carbon_cornerRadius="2dp"
        android:textColor="@color/white"
        android:background="@color/gold_color"/>

In the build.gradle

    defaultConfig {
        applicationId "wuugames.com.appdominals"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
        renderscriptTargetApi 20
        renderscriptSupportModeEnabled true
    }

P.S I'm extending from ActionBarActivity, so can that be the issue?

Thanks.

No Material buttons on <21 API

Hi, just trying out this lib. I'm trying to get material buttons with ripple effect on 4.1 (API 16) or up but only ugly normal ones show up.

Emulator with API19 on the left side, layout.xml on the right side.

0

Neither buttons have ripple.

Using a API 21 emulator both buttons have ripple effect and look like Material Buttons.

Preview in Android Studio

I have problem previewing CheckBox and CardView in Android Studio, it shows NullPointerExeption.

Exception Details java.lang.NullPointerException   
at carbon.widget.CheckBox.init(CheckBox.java:79)   
at carbon.widget.CheckBox.(CheckBox.java:42)   
at carbon.widget.CheckBox.(CheckBox.java:37)

Also, textStyle="bold" doesn't work on carbon.widget.TextView too.

Shadows and background doesn't work in RelativeLayout

Hey there,

Yes sorry for the delayed reply, your suggestion worked perfectly by wrapping the view in a parent container.

But now I have another question. I can't set a background color or elevation to the cabron.widget.RelativeLayout view. It works great with the cabron.widget.LinearLayout but not with the RelativeLayout version. Do you have any suggestion for this one?

(The below view is inside a carbon.widget.RelativeLayout parent container).

 <carbon.widget.RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            app:carbon_elevation="@dimen/low_elevation"
            >

Support ColorStateList

In some places only raw color is supported. It would be nice to support ColorStateList as a filter color.

Light Theme issue with third-party views

Currently theme carbon_Theme.AppCompat.Light extend theme Theme.AppCompat and override the styles of almost views, so it's OK to use these views in Light Theme. But when I use some third-party views, it's defaulted with Dark Theme of Theme.AppCompat (all text colors are in white).

My current workaround is to create a new theme, copy theme styles from values.xml and extends Theme.AppCompat.Light instead of Theme.AppCompat. It would be nicer if the lib can handle these third-party view.

Add canvas fallback in ShadowGenerator

There is another way for generating shadows. Using only paint shadow layer.

Check code below, and if you don't have any objections i can add pull request in next week.

TODO:

  • Check performace.

Prof:

class ShadowView extends View {
    private Paint paint = new Paint();
    private RectF rect = new RectF(50, 50, 150, 150);

    private float lerp(float a, float b, float t) {
        return a * (1.f - t) + b * (t);
    }

    private ShadowView(Context context) {
        super(context);
        paint.setAntiAlias(true);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        long tms = new Date().getTime();
        float t = Math.abs((tms % 8000) - 4000) / 4000.f;
        float t2 = Math.abs((tms % 2000) - 1000) / 1000.f;
        float corner = lerp(0, 100, t2);

        paint.setShadowLayer(lerp(3, 38, t), 0, lerp(1, 19, t), ((int) (lerp(0.12f, 0.30f, t) * 0xFF)) << 24);
        canvas.drawRoundRect(rect, corner, corner, paint);
        paint.setShadowLayer(lerp(2, 12, t), 0, lerp(1, 15, t), ((int) (lerp(0.24f, 0.22f, t) * 0xFF)) << 24);
        canvas.drawRoundRect(rect, corner, corner, paint);
        paint.setColor(0xFFFFFFFF);
        canvas.drawRoundRect(rect, corner, corner, paint);

        ViewCompat.postInvalidateOnAnimation(this);
    }
}
// ((FrameLayout) findViewById(R.id.container)).addView(new ShadowView(this), new ViewGroup.LayoutParams(200, 200));

PS. warsztatowicz.. :)

Does (beta) Dialog provide any benefit over AppCompat Dialog?

What is the purpose of your Dialog? It's just a Window holding a view, but not much other features come with this implementation. For whatever reason, when I select 'Ok', the UI freezes and the dialog does not disappear. Android already provides Dialogs in AppCompat21. Any reason why you wouldn't want to just use that directly (or extend it)?

OnItemClickListener in ListView

I'm trying to add OnItemClickListener for carbon.widget.ListView and my callback does not work.
Also I have tried adding OnClickListener on View which is inflated in adapter with no success. ( Root element of inflated view is carbon.widget.CardView )
How can I add callback after click on list item and have ripple effect on item?

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.