小编rsi*_*lli的帖子

平滑进度栏动画

我正在尝试为我实现平滑动画ProgressBar,但是当我增加时间(30秒)时,动画不再平滑.

5秒示例:

5秒

30秒示例:

30秒

我的进展背景:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape>
            <padding android:top="1dp" />
            <solid android:color="#10444444" />
        </shape>
    </item>
    <item>
        <shape>
            <padding android:top="1dp" />
            <solid android:color="#20444444" />
        </shape>
    </item>
    <item>
        <shape>
            <padding android:top="1dp" />
            <solid android:color="#30444444" />
        </shape>
    </item>
    <item android:id="@android:id/background">
        <shape>
            <solid android:color="@color/black_thirty" />
        </shape>
    </item>

    <item android:id="@android:id/progress">
        <clip>
            <shape>
                <solid android:color="#3500D0" />
            </shape>
        </clip>
    </item>
</layer-list> 
Run Code Online (Sandbox Code Playgroud)

我的进度布局:

<ProgressBar
    android:id="@+id/pb_loading"
    android:layout_width="match_parent"
    android:layout_height="8dp"
    android:indeterminate="false"
    android:layout_centerInParent="true"
    android:progress="100"
    android:progressDrawable="@drawable/my_progress_bar" />
Run Code Online (Sandbox Code Playgroud)

我的动画方法:

private void startAnimation(){
    ProgressBar mProgressBar = (ProgressBar) findViewById(R.id.pb_loading);
    ObjectAnimator progressAnimator = ObjectAnimator.ofInt(mProgressBar, …
Run Code Online (Sandbox Code Playgroud)

animation android progress-bar

22
推荐指数
5
解决办法
4万
查看次数

放大标记谷歌地图V2

我有一个ArrayList具有lat和long属性的自定义对象.

我已设法在地图上放置标记.我想要的是能够在地图加载时放大这些标记.

我在下面尝试的内容导致应用程序崩溃.

这是加载地图的代码:

public void getBridgeData() {
    db = new DbHelperClass(this);
    bridges = db.getAllBridges();
    DecimalFormat dc = new DecimalFormat("#.000");
    Builder builder = new LatLngBounds.Builder();

    for (int i= 0;i<bridges.size();i++) {
        Bridge b= (Bridge)bridges.get(i);
        double lati= b.getLatitude();
        double longo= b.getLongitude();
        double reflat= b.getReflat();
        double reflong= b.getReflong();
        LatLng start = new LatLng(reflat,reflong);
        LatLng end = new LatLng(lati,longo);
        GeneralUtils uts = new GeneralUtils();
        double ch= uts.calculateDistance(start, end);
        String chainage = dc.format(ch);
        String mysnipet = "Location:" + b.getRoadname() + " " + …
Run Code Online (Sandbox Code Playgroud)

java android google-maps

15
推荐指数
1
解决办法
5745
查看次数

如何以编程方式显示Google Maps v2工具栏

我正在尝试在Google Maps v2上显示工具栏,但只有当我触摸Marker时它才有效.

我已经实现了Litle模式并且工作,但我还需要用户交互(拖动).

我尝试过的:

  • 强制标记单击

  • 强制showInfoWindow();

谁知道怎么做?

谢谢!

在此输入图像描述

android google-maps android-maps-v2

6
推荐指数
0
解决办法
665
查看次数