我想创建库并通过Internet访问它.在Android Studio中(通过Gradle),可以通过以下方式添加依赖项:
在build.gradle(模块应用程序)中:
dependencies {
...
compile 'com.android.support:design:23.1.0'
compile 'com.squareup:otto:1.3.8'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.j256.ormlite:ormlite-android:4.48'
...
}
Run Code Online (Sandbox Code Playgroud)
如何从github以这种方式添加自己的库?
这是我的BindingAdapter:
@BindingAdapter(value = *arrayOf("bind:commentsAdapter", "bind:itemClick", "bind:avatarClick", "bind:scrolledUp"), requireAll = false)
fun initWithCommentsAdapter(recyclerView: RecyclerView, commentsAdapter: CommentsAdapter,
itemClick: (item: EntityCommentItem) -> Unit,
avatarClick: ((item: EntityCommentItem) -> Unit)?,
scrolledUp: (() -> Unit)?) {
//Some code here
}
Run Code Online (Sandbox Code Playgroud)
initWithCommentsAdapter 是一个顶级功能
这是我的布局(必不可少的部分):
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bind="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="viewModel"
type="some.example.path.CommentsViewModel"/>
<variable
name="commentsAdapter"
type="some.example.path.CommentsAdapter"/>
</data>
<android.support.v7.widget.RecyclerView
...
bind:avatarClick="@{(item) -> viewModel.avatarClick(item)}"
bind:itemClick="@{viewModel::commentClick}"
bind:commentsAdapter="@{commentsAdapter}"
bind:isVisible="@{viewModel.commentsVisibility}"
bind:scrolledUp="@{() -> viewModel.scrolledUp()}"
/>
</layout>
Run Code Online (Sandbox Code Playgroud)
当我在布局中使用kotlin方法调用分配lambda时,我在构建期间出现了这样的错误:
e: java.lang.IllegalStateException: failed to analyze:
java.lang.RuntimeException: Found data binding errors.
****/ data binding error ****msg:cannot find …Run Code Online (Sandbox Code Playgroud) 我Firebase/Core在Podfile中添加了我的项目:
pod 'Firebase/Core'
Run Code Online (Sandbox Code Playgroud)
比我补充GoogleService-Info.plist.这是我所做的一切改变.
分析工作正常,因为我在Firebase控制台的DebugView中看到了我的设备中的一些活动.
但在将应用程序上传到商店后,我收到了一封带有此文字的信件:
缺少Info.plist密钥 - 此应用程序尝试在没有使用说明的情况下访问隐私敏感数据.应用程序的Info.plist必须包含一个NSLocationWhenInUseUsageDescription键,其中包含一个字符串值,向用户解释应用程序如何使用此数据.
Firebase的安装说明没有提到它
我想为我的应用程序分析.我怎么解决这个问题?出于什么原因我需要指定NSLocationWhenInUseUsageDescription密钥?
附加信息
GoogleService-Info.plist已启用IS_GCM_ENABLED标志.我想为Intellij IDEA创建一个插件。我需要添加一个动作(AnAction),将创建一个class在科特林在自定义(不是Java) package。我有两个问题:
class(来自某个基类)创建文件package?我有一个只有俄罗斯语言环境的应用程序。如果我没有记错的话,则string.xml在res/values默认情况下是英语语言环境。但是英语和俄语有不同的复数形式。例如:
俄语:
用英语:
当用户将系统语言从俄语更改为其他语言时,问题就开始了。如何更改应用程序的默认语言?或者也许可以强制应用程序使用俄语复数?
这是我的xml布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include
android:id="@+id/toolbar"
layout="@layout/tool_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<WebView
android:id="@+id/web_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)
不幸的是,当webView滚动时,工具栏没有隐藏.
如何将WebView与SwipeRefreshLayout和可隐藏工具栏一起使用?
对不起我的英语不好.
android webview swiperefreshlayout android-toolbar coordinator-layout