小编Sha*_*zeb的帖子

Google地图的夜间模式?

我的问题很简单.谷歌地图有夜间模式吗?到目前为止,我只能申请GoogleMap.MAP_TYPE_NORMAL| GoogleMap.MAP_TYPE_TERRAIN| GoogleMap.MAP_TYPE_SATELLITE但找不到夜间模式.我想要这样的东西在此输入图像描述

不要建议我使用叠加,我已经尝试过了.我无法使用它,因为我必须在上面放置标记.

碰到这篇文章,但它已经2岁了,我想应该有一些改进.

android android-maps google-maps-android-api-2

21
推荐指数
3
解决办法
7449
查看次数

java.lang.IllegalStateException:不应为错误类型创建SimpleTypeImpl

迁移到AndroidX后一直面临此错误.

java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type: ErrorScope{Error scope for class <ERROR CLASS> with arguments: org.jetbrains.kotlin.types.IndexedParametersSubstitution@14ac19e7}
Run Code Online (Sandbox Code Playgroud)

这个链接没有多大帮助

android kotlin android-studio-3.2 androidx

20
推荐指数
3
解决办法
2652
查看次数

反转状态栏的图标颜色

我已经搜索了很多关于这一点,但我发现的是如何更改状态栏颜色.我希望在白色背景上的状态栏中反转图标的颜色,就像Soundcloud在其移动应用程序中所做的那样:

在此输入图像描述

这该怎么做?

android android-statusbar

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

通过GET方法发送值

我一直在尝试通过GET方法将数据发送到服务器,但我无法找到办法.我在异步任务中尝试了很少的代码,但没有.web服务是在cakePhp中制作的,格式如下:

Base_URI/users/add.json?json={“email”: xxx@x.com, “password”: “xxxxxxxxx”, “first_name”: “Xyz”, “last_name”: “Xyz”}
Run Code Online (Sandbox Code Playgroud)

要求Android专家找到摆脱这个问题的方法.谢谢

这是代码:

List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
            nameValuePairs.add(new BasicNameValuePair("email", UserDummy.email));
            nameValuePairs.add(new BasicNameValuePair("password", UserDummy.password));
            nameValuePairs.add(new BasicNameValuePair("first_name", UserDummy.fname));
            nameValuePairs.add(new BasicNameValuePair("last_name", UserDummy.lname));
            // Making HTTP request
    try {

        // check for request method
        if (method == "POST") {
            // request method is POST
            // defaultHttpClient
            DefaultHttpClient httpClient = new DefaultHttpClient();
            HttpPost httpPost = new HttpPost(url);
            httpPost.setEntity(new UrlEncodedFormEntity(params));

            HttpResponse httpResponse = httpClient.execute(httpPost);
            HttpEntity httpEntity = httpResponse.getEntity();
            is = httpEntity.getContent();

        } else if (method == "GET") …
Run Code Online (Sandbox Code Playgroud)

android

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

Android:如何在xml中创建床设计?

beddesign

实际上我能够通过使用RotateAnimation但是当我想要改变它并应用任何动画时遇到问题来创建这个设计.我们知道,Animation它不会改变视图的实际属性,它只会动画它.所以每当我遇到这样的问题时:

完成动画后动画回到真实状态,每次从初始位置开始.

所以为了避免这种情况,我想在xml中应用静态设计.我试过使用android:rotation但没有按照确切的要求得到.建议和帮助将是最明显的.请建议.

android android-animation

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

通过参数将Spannable应用到string.xml中的字符串

我在中定义了以下字符串string.xml

<string name="photo_heading"><xliff:g name="name">%s</xliff:g> shared a <xliff:g name="permission">%s</xliff:g><xliff:g name="photo">%s</xliff:g> with you.</string>
Run Code Online (Sandbox Code Playgroud)

String 接受 3 个字符串参数:name, permission,photo

我有两种设置不同风格的方法。

public Spannable getStyledItalic(String text) {
        Spannable sb = new SpannableString(text);
        sb.setSpan(new StyleSpan(Typeface.ITALIC), 0, text.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

        return sb;
    }
Run Code Online (Sandbox Code Playgroud)

public Spannable getStyledName(String name) {
        Spannable sb = new SpannableString(name);
        sb.setSpan(new AbsoluteSizeSpan(LPConstants.FONT_SIZE_NAME), 0, name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        sb.setSpan(new StyleSpan(Typeface.BOLD), 0, name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        sb.setSpan(new ForegroundColorSpan(mContext.getResources().getColor(R.color.app_primary)), 0, name.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

        return sb;
    }
Run Code Online (Sandbox Code Playgroud)

现在我将这些样式应用于不同的参数并返回字符串,但这不起作用。这是我正在做的事情:

public String getHeading(Printrequest printRequest) {
        String name = printRequest.sentbyname;
        String …
Run Code Online (Sandbox Code Playgroud)

xml string android spannablestring

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

带有cloudformation输出变量的Serverless.yml自定义堆栈

我是无服务器的新手,如果这很基础,请原谅。我在创建AMAZON COGNITO POOL时遇到问题,我想将此userPoolId使用到我的自定义堆栈块中以将其与appsync连接。下面是我的serverless.yml

 custom:
  accountId: 123xxxxxxxx
  appSync:
    apiId: 123xyzxxxxxxx # only required for update-appsync
    authenticationType: AMAZON_COGNITO_USER_POOLS
    userPoolConfig:
      awsRegion: ap-southeast-1
      defaultAction: ALLOW
      userPoolId: (here it only takes string but i want to reference)
  resources:
    Resources:
    # Cognito - User pool
    CognitoUserPool:
      Type: AWS::Cognito::UserPool
      Properties:
         UserPoolName: abc_xyz_pool
    # Cognito - Client
    CognitoUserPoolClient:
      Type: AWS::Cognito::UserPoolClient
      Properties:
        ClientName: abc_xyz_pool
        GenerateSecret: false
        UserPoolId:
          Ref: CognitoUserPool
    # Cognito - Identity
    CognitoIdentityPool:
      Type: AWS::Cognito::IdentityPool
      Properties:
        IdentityPoolName: sc_identity_pool
        AllowUnauthenticatedIdentities: false
        CognitoIdentityProviders:
          - ClientId:
              Ref: CognitoUserPoolClient
            ProviderName:
              Fn::GetAtt: …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services serverless

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

数据绑定失败,编译期间未找到 JAXB 类异常(使用 kapt)

我正在关注GithubBrowserSample。我所做的唯一更改是不使用NavHostFragment. 我在运行时添加片段,但代码没有编译,也没有这样有用的错误日志

应用

open class SCApp : Application(), HasActivityInjector, HasServiceInjector {

    @Inject
    protected lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Activity>

    @Inject
    protected lateinit var dispatchingServiceInjector: DispatchingAndroidInjector<Service>

    override fun onCreate() {
        super.onCreate()

        AppInjector.init(this)
    }

    override fun activityInjector() = dispatchingAndroidInjector

    override fun serviceInjector() = dispatchingServiceInjector
}
Run Code Online (Sandbox Code Playgroud)

活动

class IncomingLeadActivity : AppCompatActivity(), HasSupportFragmentInjector {

    lateinit var binding: ActivityIncomingLeadBinding

    private lateinit var incomingLeadViewModel: IncomingLeadViewModel

    @Inject
    lateinit var viewModelFactory: ViewModelProvider.Factory

    @Inject
    lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Fragment>

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        binding = DataBindingUtil.setContentView(this, …
Run Code Online (Sandbox Code Playgroud)

kotlin dagger-2 android-databinding kapt androidx

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

在 Android Studio 中创建新项目时出错

Android Studio 每天都运行良好。但是从昨天开始,当我创建一个新项目时,它开始显示错误。当我点击 Finish 创建一个新项目时,除了出现此错误外,什么也没有发生:

CalledFromWrongThreadException
            Access is allowed from event dispatch thread only.
            Details: EventQueue.isDispatchThread()=false
            isDispatchThread()=false
            Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@7593de93
            Current thread: Thread[ApplicationImpl pooled thread 13,4,main] 374296670
            SystemEventQueueThread: Thread[AWT-EventQueue-0 1.4#AI-141.2288178, eap:false,6,main] 400805665
            "AWT-EventQueue-0 1.4#AI-141.2288178, eap:false" prio=0 tid=0x0 nid=0x0 runnable
            java.lang.Thread.State: RUNNABLE
            at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.access$100(InjectedLanguageManagerImpl.java:66)
            at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl$3.daemonCancelEventOccurred(InjectedLanguageManagerImpl.java:109)
            at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:497)
            at com.intellij.util.messages.impl.MessageBusConnect... (show balloon)
Run Code Online (Sandbox Code Playgroud)

如果我单击显示气球,它会显示扩展版本。它太大了,所以我决定发布一个简短的。我正在使用 Android Studio 1.4

感谢您的帮助。

android

2
推荐指数
3
解决办法
6536
查看次数

:app:transformClassesWithDexForDebug在编译Firebase时

在我的应用程序中,我想使用Firebase作为后端.我也支持Facebook和谷歌登录.在依赖添加Firebase之前,我的项目已成功编译,但在添加Firebase后,我收到此错误:

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable840Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE …
Run Code Online (Sandbox Code Playgroud)

android firebase google-play-services facebook-sdk-4.x

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

ScrollView不能完全滚动底部

在您将其标记为重复之前,让我告诉您,我已经搜索了所有答案,但都是徒劳的。

我使用TabsActionbar

我已经设置android:layout_height="match_parent"ScrollView,如许多解决方案建议。

我还android:layout_gravity="center"按照以下建议从所有布局中删除了: Android scrollview隐藏布局中的顶部内容

我也定了,android:fillViewport="true"但是没有运气。

我还缺少其他任何技巧吗?

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">
<LinearLayout
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <CalendarView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/calendarView" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:hint="Guest"/>

        <NumberPicker
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

        </NumberPicker>

    </LinearLayout>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/title_time_slot"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/title_add_on"/>

    <Button
        android:id="@+id/btn_confirm"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/title_btn_confirm"/>
</LinearLayout>

</ScrollView>
Run Code Online (Sandbox Code Playgroud)

这是活动的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"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.squincy.wspace.ui.HomeActivity">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar" …
Run Code Online (Sandbox Code Playgroud)

android android-scrollview

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