Android AppMsg (Crouton) Library

Android AppMsg (Crouton) Library

Implementation of in-layout notifications. Based on Toast notifications and article The making of Prixing #4: in-layout notifications by Cyril Mottier.


Description

Toast is far from being perfect and I am not entirely satisfied with it. Toast can be un-accurate in some cases. Indeed, Toast has one major drawback: it completely breaks contexts. This issue can be reproduced effortless. Let’s say a user is currently in an app firing a Toast and wants to switch to another application using the dedicated “multitask” button. The Toast will remain on screen even if the brought-to-front application has nothing do to with the previously shown app as described on the following figure: Example Image

As you can easily notice, the problem with Toasts is they are persistent. Once a Toast has been fired, it is displayed on top of any screen and remains visible for the duration specified at its creation.

In order to bypass the Toast persistence problem and ensure information is displayed in the correct context, we decided to create a new notification system: Activity-bound notifications. This is what it looks like in the current version of Prixing: Example Image

Crouton overcomes the main issue of having a Toast being shown while the menu is open. It sticks to the current screen sliding with it and leaving the menu completely free of any information that would have not been related to it.

Copyright (C) by Cyril Mottier

Sample

A sample application is available on Google Play:

Get it on Google Play

Example Image

The source code is available in this repository.

Compatibility

This library is compatible from API 4 (Android 1.6).

Installation

The sample project requires:

Usage

Android AppMsg is presented as an Android library project. You can include this project by referencing it as a library project in Eclipse or ant.

To display the item you need the following code:

  • Show AppMsg:
AppMsg.makeText(/*Activity*/, /*CharSequence*/, /*AppMsg.Style*/).show();

Gradle

Android-AppMsg Library is now pushed to Maven Central as a AAR, so you just need to add the following dependency to your build.gradle.

dependencies {
    compile 'com.github.johnkil.android-appmsg:appmsg:1.2.0'
}

Example Gradle project using Android-AppMsg:

Contribution

Please fork dev repository and contribute back using pull requests.

Contributors are recommended to follow the Android Code Style Guidelines.

Any contributions, large or small, major features, bug fixes, additional language translations, unit/integration tests are welcomed and appreciated but will be thoroughly reviewed and discussed.

Developed By

License

Copyright 2012 Evgeny Shishkin

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

原文地址:https://github.com/johnkil/Android-AppMsg#android-appmsg-crouton-library

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 要在Chromebook上安装Linux,您需要先启用Chromebook上的开发者模式。然后,您可以通过Crouton或Chromebrew等工具来安装Linux。安装Linux后,您可以使用Linux应用程序和命令行工具来扩展Chromebook的功能。但请注意,安装Linux可能会影响Chromebook的安全性和稳定性,因此请谨慎操作。 ### 回答2: Chromebook是一种基于Chrome OS的操作系统的笔记本电脑。虽然Chrome OS可以运行许多应用程序,但有些用户需要更广泛的功能,例如使用Linux的命令行和软件。因此,可以在Chromebook上安装Linux以满足这些需求。 首先,要安装Linux,您需要启用Chromebook上的“开发者模式”。要进入开发者模式,首先,请备份您的所有文件并确保Chromebook已连接到电源。然后,按住Esc + F3(Chromebook上的切换功能键)+ 电源按钮,然后释放所有这些键。Chromebook将进入恢复模式。 在恢复模式下,您需要按Ctrl + D,然后按Enter键。您将会收到一条警告,提示您确信要进入开发者模式。按Enter再次确认。Chromebook将自行重启并进入开发者模式。 现在您有了开发者模式,需要打开Chromebook上的“Linux(Beta)”功能。前往Chromebook的设置并选择“设备”>“Linux Beta”,随后按照提示启用它。系统将自动下载并安装Linux虚拟机容器。 与此同时,建议您下载和安装一个名为“Crouton”的Linux发行版,它与Chrome OS安装在同一个虚拟机容器中,并为您提供享有Linux游戏和软件的命令行界面。该软件也能帮助您在Chromebook上快速安装Linux发行版。 最后,为了使用Linux,您需要打开终端并输入以下命令:sudo startgnome 或 sudo startxfce4。这将启动您安装的GNOME或Xfce桌面环境。现在,您可以使用Linux命令行和应用程序,您可以在Chromebook上进行更广泛的任务! 总之,将Linux安装到Chromebook上是一个相对简单的过程,需要您注意一些关键步骤。一旦您完成了所有步骤,您将能够在Chromebook上使用Linux的命令行和应用程序,满足您更广泛的需求。 ### 回答3: 随着Chromebook在市场上的快速普及,越来越多的用户想要在Chromebook上使用Linux。Chromebook本身是一种基于Google Chrome浏览器的操作系统,但是安装Linux可以为用户提供更多功能和灵活性。 首先需要说明的是,Chromebook是基于Google Chrome OS的,这意味着它并不是一个传统意义上的计算机。Chromebook的本质是一款浏览器,因此它并不支持像Windows或Mac OS那样的原生程序安装。这就是为什么在Chromebook中安装Linux会比在其他设备上更加复杂的原因。 但是,Chromebook作为一种基于Linux内核的操作系统,是可以使用Linux的。Google为Chromebook提供了一个称为“开发人员模式”的选项,用户可以在这个模式下安装和运行Linux应用程序。以下是步骤: 步骤一:打开“开发人员模式” - 这个选项可以通过按下“ESC + 刷新 + 电源”来打开,这样您就可以进入Chromebook的开发人员模式。 步骤二:下载Crouton - Crouton是一个用于在Chromebook上安装Linux的软件。 步骤三:启动Crouton - 打开“终端”并输入以下命令: sudo sh ~/Downloads/crouton -t [desktop environment] [desktop environment]将是您想要安装的桌面环境。例如,如果您想要安装Ubuntu,这将是“xfce”或“unity”之一。 步骤四:等待安装完成 - 安装会需要一些时间。安装完成后,您将可以通过在Chromebook的开发人员模式下切换到Linux环境。 总的来说,Chromebook在安装Linux方面略有些复杂,但对于那些想要更多功能和灵活性的用户来说,这是一个值得尝试的方法。如果遵循正确的步骤,安装Linux将为Chromebook带来更多功用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值