小编Ale*_*day的帖子

Android gradle任务Google Appengine

我正在尝试为我的Android应用程序编写一个gradle任务,启动google appengine开发人员服务器,运行测试,然后关闭服务器.

到目前为止我尝试过的是这样的:

task runAppEngine (dependsOn: ":backend:appengineRun") <<{
   //run test 
   //stop development server
    }
Run Code Online (Sandbox Code Playgroud)

appengineRun任务运行,但是我在gradle任务的doLast部分放置的任何内容似乎都没有执行.例如,如果我输入println语句,它永远不会打印到控制台.

我也不确定如何从任务中调用appengineStop以停止开发服务器.

感谢任何人都能提供的帮助!

google-app-engine android gradle build.gradle

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

带有协调器布局的 ViewPager

我的活动布局如下所示:

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        app:layout_scrollFlags="scroll|enterAlways"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary" />

    <android.support.design.widget.TabLayout
        android:id="@+id/tab_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>

<android.support.v4.view.ViewPager
    android:id="@+id/view_pager"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
Run Code Online (Sandbox Code Playgroud)

viewpager 有两个片段,一个带有 RecyclerView,另一个带有 LinearLayout。

具有 RecyclerView 的片段按预期工作,并且当滚动 RecyclerView 时操作栏会滚动到屏幕外。

然而,带有 LinearLayout 的另一个片段没有按照我想要的方式显示。LinearLayout 绘制在 TabLayout 下方并延伸到屏幕外。我希望调整它的大小以填充 TabLayout 下方的可用空间,而无需扩展到屏幕外。LinearLayout 看起来像这样:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:id="@+id/station_detail_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <include
            layout="@layout/station_detail_title"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="3" />

        <include
            layout="@layout/station_detail_body"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="2" />


    </LinearLayout>

    <TextView
        android:id="@+id/text_view_station_detail_empty"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_horizontal|center_vertical"
        android:text="@string/text_view_station_detail_empty"
        android:visibility="gone" />
</LinearLayout> …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-fragments android-coordinatorlayout

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