项目需求讨论 — 待机界面

一天,产品经理走过来搭了下我的肩膀。</br>
产品经理:我要我们的APP有一个酷炫的待机界面。</br>
我:可以啊,你要怎么样的界面?</br>
产品经理:我也不知道啊,要么像手机店里面那种展览的手机知道不,不是经常有个待机界面,那种颜色不停变化的那种,我们也搞个这种,然后就五彩斑斓的黑色,记住哦。弄好给我看看效果</br>
我:产品经理666,mmp,产品经理一个需求就够我玩一年....

反正我不是读书人

我走到美工那里,准备甩锅,</br>
我:产品经理要五彩斑斓的黑色,反正我也不知道,别问我具体东西,你看着办吧。</br>
美工:XXXXXXXXXXXXX。

最后美工给了我一组颜色值:

然后说她的任务完成了。也不管了。又把锅扔给我。</br>

最后打算用我所标识的1-2-3的顺序来做。

(PS:转成gif后变的很模糊很奇怪了.....)

根据美工给的色值,我们可以先做四个界面:


color_first.xml:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:startColor="#81FFEF"
        android:endColor="#F067B4"
        android:angle="0"/>
</shape>

color_second.xml:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:startColor="#F6D242"
        android:endColor="#FF52E5"
        android:angle="135"/>
</shape>

color_third.xml:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:startColor="#FFA8A8"
        android:endColor="#FCFF00"
        android:angle="135"/>
</shape>

color_firth.xml:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:startColor="#81FFEF"
        android:endColor="#FFA8A8"
        android:angle="135"/>
</shape>

我们四个界面都做好了。我们把它们四个放在一起:
color_list.xml:

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    >
    <item
        android:drawable="@drawable/color_first"
        android:duration="3000" />
    <item
        android:drawable="@drawable/color_second"
        android:duration="3000" />
    <item
        android:drawable="@drawable/color_third"
        android:duration="3000" />

    <item
        android:drawable="@drawable/color_firth"
        android:duration="3000" />

</animation-list>

activity_layout.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ll_splash"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/color_list"
    android:orientation="vertical">

</LinearLayout>

Activity.java:

public class SplashActivity extends Activity {
    AnimationDrawable anim;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        
        LinearLayout container = (LinearLayout) findViewById(R.id.ll_splash);
        anim = (AnimationDrawable) container.getBackground();
        anim.setEnterFadeDuration(2000);
        anim.setExitFadeDuration(1000);
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (anim != null && !anim.isRunning())
            anim.start();
    }
    
    @Override
    protected void onPause() {
        super.onPause();
        if (anim != null && anim.isRunning())
            anim.stop();
    }
}

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,856评论 25 709
  • 我估计百分之90的人做具体项目的时候,都会有A(登录界面) —> B(主界面) —> A(退出登录)。我想说明的是...
    青蛙要fly阅读 7,453评论 11 27
  • 做一个平静的low逼也行。 做一个平静的牛逼。我想牛逼,一定要牛逼。不容易平静。 我想牛逼,没成,low逼也行。 ...
    大橙大橙阅读 2,206评论 0 0
  • 人是群居动物,没有人能离开群体而独居于世。有人的地方就会热闹,就会有集市,有活动,就会从一个村落发展成一个城市。 ...
    爷有淑女范儿阅读 4,245评论 0 2
  • 现在来到西方国家开启了短暂的生活 自己曾相当地自卑 英语不好 我以前一直以来对自己的英文很有自信 感觉来到这里以后...
    Bella和book阅读 3,237评论 0 0