小编Luc*_*tos的帖子

Firebase在滚动时动态加载数据

我需要知道如何在使用Firebase滚动时动态加载数据.如果我使用Firebase查询数据,则必须一次性加载所有数据或始终更改数据.我希望每个限制使用Firebase加载数据,并且在达到此限制后,加载更多数据并且越来越多.

它基本上就像Facebook的时间线 - 作为一个社交网络.

例如:我想从Firebase获得最低限度50的最新记录.达到此限制后,我将下载下50个数据.我想用RecyclerView而不是FirebaseRecycler上课.

FirebaseRecyclerAdapter无法解决我的问题.感谢帮助.我需要点视图布局的facebook时间线等loadind数据,以及点视图数据库的加载数据Firebase(50到50个.下载50个数据,达到限制,加载底部布局的更多数据到50).

你可以帮帮我吗?

android android-scrollview firebase android-recyclerview firebase-realtime-database

9
推荐指数
1
解决办法
4963
查看次数

Android Studio 0.8.2如何附加javadoc支持库

我需要在我的项目中附加javadoc for support library v4:20.我的libs文件夹是空的.它不包含支持库.我的项目正在运行,但支持库不是javadoc.我的build.gradle是:

apply plugin: 'android'

android {
    compileSdkVersion 20
    buildToolsVersion '20.0.0'

    defaultConfig {
        applicationId "com.myapp"
        minSdkVersion 14
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    // You must install or update the Support Repository through the SDK manager to use this dependency.
    compile 'com.android.support:support-v4:20.+'
    compile 'com.android.support:appcompat-v7:20.+'
}
Run Code Online (Sandbox Code Playgroud)

以这种方式添加了库支持:

在此输入图像描述

android android-studio

3
推荐指数
1
解决办法
2030
查看次数

动画期间在ImageView上的OnTouchListener,有时不会被触发/调用

我有

  1. 布局游戏(相对布局)
  2. ImageView(播放器)
  3. ViewPropertyAnimator(动画)

我的代码是:

final Vibrator vibe = (Vibrator) getContext().getSystemService(Context.VIBRATOR_SERVICE);
    final ImageView playerImageView = (ImageView) layoutInflater.inflate(R.layout.player, null);
        playerImageView.setLayoutParams(new RelativeLayout.LayoutParams(playerSizeX, playerSizeY));
        playerImageView.setImageDrawable(playerDrawable);
        playerImageView.setX(playerVisualPositionX);
        playerImageView.setY(playerVisualPositionY);
        playerImageView.setOnTouchListener(new OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
                    vibe.vibrate(100);
                    touchedPlayer();
                }

                return true;
            }
        });

        layoutGame.addView(playerImageView);
        ViewPropertyAnimator viewPropertyAnimator = playerImageView.animate();
        viewPropertyAnimator.x(positionAnimateX); // The view will be animated such that it moves to positionAnimateX.
        viewPropertyAnimator.y(positionAnimateY); // The view will be animated such that it moves to positionAnimateY.
        viewPropertyAnimator.setDuration(animationTime);
        viewPropertyAnimator.setListener(new …
Run Code Online (Sandbox Code Playgroud)

android imageview android-animation android-layout

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