Giter Site home page Giter Site logo

catloadingview's Introduction

Android CatLoadingView

This project idea is from Link.
Thanks for the idea.

I like the animation in this picture:

...as you see it right now, I hope you like it!

Step

Import this project into Android Studio... it's built with it.

Usage

Gradle

implementation 'com.roger.catloadinglibrary:catloadinglibrary:1.0.9'

config in java code

CatLoadingView mView;


@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mView = new CatLoadingView();
findViewById(R.id.button).setOnClickListener(
	new View.OnClickListener() {
	    @Override public void onClick(View v) {
		mView.show(getSupportFragmentManager(), "");
	    }
	});
}

Set Background Color

	mView.setBackgroundColor(Color.parseColor("#000000"));

TODO

This view is adjusted in Nexus5 but not tested on other screen sizes.

About me

A small guy in Fujian, mainland China.

If you have any new ideas about this project, feel free to tell me. Tks. 😃

License

The MIT License (MIT)

Copyright © 2015 Roger

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Android Arsenal

catloadingview's People

Contributors

aliazaz avatar ardacebi avatar crystalstiletto avatar femytry avatar martinloesethjensen avatar narenderbhadrecha avatar rogero0o 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

catloadingview's Issues

返回键问题

按返回键时都会dismiss,即便是加了

catLoadingView.setCancelable(false);
catLoadingView.setClickCancelAble(false);

这两行也是一样,这两行只能让点击不能取消,但是返回键还是可以,有什么办法让返回键不能dismiss吗?

Cancelable and onResume event

There are some bugs I've experienced in your library:

  • Cancelable = false is not working
  • If onPause event call some of the animations (mouse, eyeLeft, eyeRight) don't resume

Dismissable

By clicking on the screen, you can close the dialog.
Please add the ability to make the dialog not closable.

Reduce minSDKVersion

The minSDKVersion = 19, please can you reduce it to a lower minSDKVersion like 15 ?

Btw, awesome Library!!!.

Thanks

An update or feature!

Function to change the text (Loading) to any desired text.
Also, the background color is not changing.

java.lang.IllegalStateException: Fragment already added: CatLoadingView

When I use the CatLoadingView in my activity, it works fine. But when I kill the activity and come back the second time to use the CatLoadingView I get: java.lang.IllegalStateException: Fragment already added: CatLoadingView.

This is the method for display the CatLoadingView

` public void displayLoader(FragmentManager fm, boolean display) {
if (view == null) {
view = new CatLoadingView();
view.setBackgroundColor(Color.parseColor("#88003CC0"));
view.setText("Please wait");
}

    if (display) {
        if (!view.isAdded())
            view.show(fm, TAG);
    } else if (!display && view.isVisible()){
        view.dismiss();
    }

}`

setBackgroundColor attribute not detected

I wanna change background color of dialog but it doesnt detect setBackgroundColor attribute, what i need to do

mView.setBackgroundColor(Color.parseColor("#000000"));

Sorry but i can't do display text : Loading ...

thank you for answ .But it still not working . Here my code :

mView = new CatLoadingView();
GraduallyTextView mGraduallyTextView = new GraduallyTextView(getApplicationContext());
mGraduallyTextView.setText("Loading...");
findViewById(R.id.button).setOnClickListener(
new View.OnClickListener() {
@OverRide
public void onClick(View v) {
mView.show(getSupportFragmentManager(), "");
}
});

Changing color

How can I change background color? The color doesn't match with my theme

Force closed with error message: "java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState"

How to create the issue

  • Create and show CatLoadingView
if (catLoadingView == null) {
    catLoadingView = CatLoadingView()
    catLoadingView?.isCancelable = false
}
catLoadingView?.show(supportFragmentManager, "")
  • Dismiss CatLoadingView
catLoadingView?.dismiss()
  • Start other activity with startActivityOnResult
  • Dismiss the new activity with RESULT_OK
  • Show CatLoadingView again with the first code inside onActivityResult of the first Activity

What I have try to solve the problem

  • Set the CatLoadingView to null after dismissed
catLoadingView = null
  • Change the dismiss code with dismissAllowingStateLoss
catLoadingView?.dismissAllowingStateLoss()
override fun onSaveInstanceState(outState: Bundle) {
    outState.putString("WORKAROUND_FOR_BUG_19917_KEY", "WORKAROUND_FOR_BUG_19917_VALUE")
    super.onSaveInstanceState(outState)
}

But didn't help
What working is wrapping the code with try catch that catch IllegalStateException but this workaround will make the CatLoadingView not showing at all after showed for the first time.

Stack trace

java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:2053)
at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:2079)
at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:678)
at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:632)
at android.support.v4.app.DialogFragment.show(DialogFragment.java:143)
...

同一个页面,我如何让catloadingview再一次show出来

你好,我现在遇到这样的问题:
当我从关闭另一个activity的时候得到onActivityResult的回调,这个时候再次调用catLoadingView的时候会崩溃,异常是not perform this action after onsavedInstanceState,意思是保存状态之后我不能再添加commit这个事务了,那么我应该如何再次show出catLoadView.

严重bug

screenshot_2016-05-25-13-31-57_com zxy administrator iwantindiana

眼睛上面的眉毛 太突出了,都跑到脸的外边去了,
下面的L O A D I N G ...文字只显示了 一半。

**人

湖建啊 可以啊

Null pointer Exception in mView.dismiss() after configuration changes

I am getting -

java.lang.NullPointerException: Attempt to invoke virtual method android.support.v4.app.FragmentTransaction android.support.v4.app.FragmentManager.beginTransaction()' on a null object reference
when i rotate the phone and it crashes becuase of mView.dismiss(). Please help.)

android support v7 support for fragments

hey !

I am trying to use your plugin to make a cordova plugin and I got hit with this error when trying to call the method show() :

error: no suitable method found for show(android.app.FragmentManager,String)
method DialogFragment.show(android.support.v4.app.FragmentManager,String) is not applicable
(argument mismatch; android.app.FragmentManager cannot be converted to android.support.v4.app.FragmentManager)
method DialogFragment.show(FragmentTransaction,String) is not applicable
(argument mismatch; android.app.FragmentManager cannot be converted to FragmentTransaction)

It is clearly a problem with android support library version. Is there anyway you can fix this in a newer version ?

android4.4.2

android4.4.2不显示LOADING...字,是什么原因?

onBakcPressed

how can i dismiss this dialogue onBackPressed( ) ?
i am using catLoadingView.setCancelable(false);
this is not working for me. Please guide me.

超喜欢你的设计,但是有些bug

在nexus的机子上run都没有问题,可是在非google手机上,like 华为,run的时候,loading的下半部分被遮住了!ToT!
有的时候眼睛,eyelipview与猫脸的背景没有对齐,导致眼珠转到了外面!
希望对你改进这个设计有帮助!!

实在太喜欢这个设计了!谢谢。

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.