标签: crouton

Crouton依赖于图书馆但不是图书馆本身

我正在使用Android Studio 0.6.1,使用Crouton库,今天在gradle sync之后我遇到了下一个错误:

Error:A problem occurred configuring root project 'project_name'.
Module version de.keyboardsurfer.android.widget:crouton:1.8.4 depends on libraries but is not a library itself
Run Code Online (Sandbox Code Playgroud)

那是怎么回事?

android gradle crouton android-studio

38
推荐指数
2
解决办法
7558
查看次数

Crouton + SlidingMenu重叠

我正在使用SlidingMenuCrouton,但我发现滑动菜单与crouton通知重叠

烤面包片和滑动菜单重叠

我会在github中报告一个问题,但我不知道bug在哪里.

Cyril Mottier在他的Prix​​ing文章中提到了布局通知存在3个上下文,左侧菜单本身就有一个上下文.这样,通知就会与其他内容一起滑动.

在此输入图像描述

因为SlidingMenu和Crouton都使用Activity Context,也许这根本不可修复.我们可以轻松打电话

Crouton.cancelAllCroutons();
Run Code Online (Sandbox Code Playgroud)

在显示SlidingMenu之前,我喜欢Prixing的滑出功能.

希望图书馆的作者可以声称这个错误或对它有所了解.

谢谢!

编辑:

我通过创建对象并将其附加到活动来使用SlidingMenu

private void configureSideMenu() {
   mSlidingMenu = new SlidingMenu(this);
   mSlidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
   mSlidingMenu.setFadeDegree(0.35f);
   mSlidingMenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
   mSlidingMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
   mSlidingMenu.setMenu(R.layout.menu_frame);
   getSupportFragmentManager().beginTransaction().replace(R.id.menu_frame, new MySideMenuFragment()).commit();
 }
Run Code Online (Sandbox Code Playgroud)

而Crouton,我想只有一种方法可以使用它

  Crouton.showText(this, R.string.error_not_logged_in, Style.ALERT);
Run Code Online (Sandbox Code Playgroud)

是这两种情况下相同的活动

android slidingmenu crouton

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

在Android中设置Crouton消息的持续时间

我已经开始使用Crouton消息而不是Toast消息,因为我可以配置持续时间.有没有什么方法可以继续显示crouton消息,直到特定事件,而不是以明确单位指定时间?

android crouton

6
推荐指数
2
解决办法
2412
查看次数

为什么自定义烤面包片样式显示为灰色而不是指定的颜色?

我想为我的应用程序的烤面包片定制样式.为多种样式设置4种颜色.这是我的自定义样式类

public class TapabookCroutonStyle {
public static final int DURATION_INFINITE = -1;
public static final Style ALERT;
public static final Style WARN;
public static final Style CONFIRM;
public static final Style INFO;

public static final int AlertRed = R.color.rojo_vivo;
public static final int WarnOrange= R.color.naranja_resplandeciente;
public static final int ConfirmGreen = R.color.verde_lima;
public static final int InfoYellow = R.color.amarillo_canario;

private static final int DURATION_SHORT  = 3000;
private static final int DURATION_MEDIUM = 5000;
private static final int DURATION_LONG   = 10000; …
Run Code Online (Sandbox Code Playgroud)

customization android crouton

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

Android Studio gradle和库导入

我已成功将ActionBarSherlock导入到我的项目中,并需要导入另外两个库:Sliding LayerCrouton.我知道之前已经出现过类似的问题了,但是我几乎尝试了所有的东西,每次都以一种我必须重新开始的方式破坏项目中的某些东西.

我的项目树看起来像:

MyProject/
+ app/
+ libraries/
   + actionbarsherlock/
   + crouton/
   + slidinglayer/
Run Code Online (Sandbox Code Playgroud)

我将这两个库导入为模块(文件 - >导入模块)

我的setting.gradle文件看起来应该是:

include ":libraries:actionbarsherlock", ':Krypto', ':libraries:crouton', ':libraries:slidinglayer'
Run Code Online (Sandbox Code Playgroud)

actionbarsherlock gradle:

buildscript {
    repositories {
        maven { url 'http://repo1.maven.org/maven2' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.5.+'
    }
}
apply plugin: 'android-library'

dependencies {
    compile files('libs/android-support-v4.jar')
}

android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 16
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            res.srcDirs = …
Run Code Online (Sandbox Code Playgroud)

android gradle actionbarsherlock crouton android-studio

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

我无法在Eclipse中访问Crouton库

我遵循了使用带有Eclipse的crouton库的所有步骤,但我仍然无法使用它.

以下是我遵循的步骤:

  1. 从GitHub克隆Crouton库.
  2. 解压缩文件并复制出库文件夹.
  3. 打开eclipse并将库导入工作区(名称更改为"main").
  4. 右键单击"main",然后在android tools选项中选择Add Support Library.
  5. 打开项目属性将构建目标设置为4.4.2,并勾选'is library'.
  6. 在我想要使用crouton的项目中,我将它作为属性选项中的库添加.

完成所有这些步骤后,我尝试创建一个烤面包片.例如:

Crouton.showText(
  this, 
  getString(R.string.crouton_message2), 
  Style.CONFIRM); 
Run Code Online (Sandbox Code Playgroud)

Eclipse说Crouton无法解析为变量.当我尝试导入它时,我找不到它.

这些是我所有研究中遵循的步骤,这是我发现的内容,来自Grokking androidYouTube视频的帖子

这不是我第一次使用库.我一直在使用android appcompat库一段时间没有任何问题.我在设置过程中使用的步骤与is几乎相同,只是在所有上述步骤之后的appcompat库中,我不得不复制jar文件并将其放入lib中.需要它的项目的文件夹.我错过了什么?

谢谢您的帮助.

eclipse android crouton

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

油煎面包块不时显示

我的应用程序中有官方导航抽屉.单击抽屉中的项目会在屏幕的内容部分中打开新的片段.每个片段包含FrameLayout相同的id,用于显示Crouton.

基本用法是当用户单击Action Bar中的刷新按钮时显示无限的Crouton(通知正在进行的刷新).刷新完成后,会显示另一个烤面包片(替换旧的烤面包片).在某些情况下,即使在输入屏幕后也会显示Croutons(并在触发刷新时替换).

我遇到的问题有点难以描述.有些面包丁不时不显示.(初始Crouton未示出或当我按下刷新按钮的第一次在该屏幕上未示出的Crouton -然而,它通常当我屏幕间切换发生显示时刷新结束,当我之后按下刷新按钮) .

所以这是非常不可预测的.甚至有些情况下,当我切换到另一个屏幕并返回时,屏幕根本不显示Crouton.

为了显示Croutons,我在每个Framgnet的布局中使用它:

<FrameLayout
    android:id="@+id/crouton_view"
    android:layout_width="match_parent"
    android:layout_height="@dimen/crouton_height"
    android:layout_alignParentTop="true" />
Run Code Online (Sandbox Code Playgroud)

在代码中我有CroutonBuilder类,有以下方法:

public static Crouton getNewLastUpdateCrouton(Activity activity, boolean infinite, String plateNumber) {
    String lastUpdateString = ...;
    Crouton newCrouton = Crouton.makeText(activity, lastUpdateString, CroutonBuilder.getLastUpdate(activity),
                                    R.id.crouton_view);
    if (infinite) {
        newCrouton.setConfiguration(new Configuration.Builder().setDuration(
                                        Configuration.DURATION_INFINITE).build());
    }
    return newCrouton;
}
Run Code Online (Sandbox Code Playgroud)

然后只需要调用.show()返回的Crouton.当我调试并逐步执行时,show()调用该方法,但有时只显示任何内容.

你有什么想法我做错了吗?

android android-fragments crouton

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

具有无限持续时间的Crouton CustomView

我一直在思考crouton,在创建了一个customView crouton popup后,我注意到了两件事; - 在创建时稍微修改了布局,如果视图更新,则会更正 - 无法添加样式来制作自定义烤面包片,或者我不知道...有人请提供一种方法来执行每个操作这些整齐

Crouton创建代码:

View crouton_view = getLayoutInflater().inflate(R.layout.crouton_layout, null);
Crouton Date_crounton = Crouton.make(this, crouton_view);
crouton_view.setBackgroundColor(Color.rgb(00, 153, 204));
Date_crounton.show();
Run Code Online (Sandbox Code Playgroud)

布局代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/crouton_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<EditText
    android:layout_width="match_parent"
    android:layout_height="50dp" />

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

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#b4b4b4" />
</LinearLayout>

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

    <Button
        android:id="@+id/crouton_cancel"
        style="?android:attr/actionButtonStyle"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_weight="1"
        android:gravity="center"
        android:text="Cancel"
        android:textSize="14sp" />

    <ImageView
        android:layout_width="1dp"
        android:layout_height="30dp"
        android:layout_gravity="center_vertical"
        android:background="#b4b4b4" />

    <Button
        android:id="@+id/crouton_ok"
        style="?android:attr/actionButtonStyle"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_weight="1"
        android:gravity="center"
        android:text="OK"
        android:textSize="14sp" />
</LinearLayout>

<LinearLayout …
Run Code Online (Sandbox Code Playgroud)

android crouton

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

通知像whatsapp或短信应用程序android

我想创建一个通知视图就像whatsapp或短信通知.我怎么能实现这一点.

在此输入图像描述

我到现在为止所搜索的内容

克鲁顿:可以在这里找到

这将在跑步活动中显示一个烤面包片,在操作栏下方显示.如果我的活动没有运行或我正在进行另一项活动,那么它如何处理.

吐司:这看起来不像吐司.它仅显示在底部或中心.

对话框:这可以这样做但这会使应用程序模糊.并禁用背景.我不想要这个

任何解决方案都将受

谢谢

notifications android dialog whatsapp crouton

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

可以在Crouton中使用进度条吗?

我想用进度条显示自定义Crouton警报,我想动态更新进度.这是我的代码,但它不起作用.我怎样才能做到这一点?或者如何在图片上传时显示进度条

private void showCustomViewCrouton() {
    // try {
    View view = getLayoutInflater().inflate(R.layout.crouton_custom_view,null);
    pB = (ProgressBar) view.findViewById(R.id.progressBar1);
    final Crouton crouton;
    final Configuration croutonConfig = new Configuration.Builder()
            .setDuration(Configuration.DURATION_INFINITE)
            .setInAnimation(android.R.anim.fade_in)
            .setOutAnimation(android.R.anim.fade_out).build();
    crouton = Crouton.make(this, view, R.id.croutonContainer, croutonConfig);       
    view.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            crouton.hide(crouton);
        }
    });

    crouton.show();

    try{
        do{
                Thread.sleep(100);
                deger+=1;
                pB.setProgress(deger);          
        }while(deger<101);      
    }catch(Exception e){

    }       
}
Run Code Online (Sandbox Code Playgroud)

android progress-bar crouton

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