Showing preview only (357K chars total). Download the full file or copy to clipboard to get everything.
Repository: thiagokimo/Faker
Branch: master
Commit: 8b0eccd49981
Files: 108
Total size: 323.8 KB
Directory structure:
gitextract_z0fqpsma/
├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── app/
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── io/
│ │ └── kimo/
│ │ └── faker/
│ │ ├── FakerApp.java
│ │ ├── mvp/
│ │ │ ├── BasePresenter.java
│ │ │ ├── BaseView.java
│ │ │ ├── Presenter.java
│ │ │ ├── View.java
│ │ │ ├── presenter/
│ │ │ │ ├── AddressPresenter.java
│ │ │ │ ├── ColorPresenter.java
│ │ │ │ ├── InternetPresenter.java
│ │ │ │ ├── LoremPresenter.java
│ │ │ │ ├── NamePresenter.java
│ │ │ │ ├── NumberPresenter.java
│ │ │ │ ├── PhonePresenter.java
│ │ │ │ └── UrlPresenter.java
│ │ │ └── view/
│ │ │ ├── AddressView.java
│ │ │ ├── ColorView.java
│ │ │ ├── InternetView.java
│ │ │ ├── LoremView.java
│ │ │ ├── NameView.java
│ │ │ ├── NumberView.java
│ │ │ ├── PhoneView.java
│ │ │ └── UrlView.java
│ │ └── ui/
│ │ ├── activity/
│ │ │ └── MainActivity.java
│ │ └── fragment/
│ │ ├── AddressFragment.java
│ │ ├── ColorFragment.java
│ │ ├── InternetFragment.java
│ │ ├── LoremFragment.java
│ │ ├── NameFragment.java
│ │ ├── NumberFragment.java
│ │ ├── PhoneFragment.java
│ │ ├── ProfileFragment.java
│ │ ├── TargetViewsFragment.java
│ │ ├── UrlFragment.java
│ │ └── WidgetsFragment.java
│ └── res/
│ ├── layout/
│ │ ├── activity_with_toolbar.xml
│ │ ├── fragment_address.xml
│ │ ├── fragment_color.xml
│ │ ├── fragment_internet.xml
│ │ ├── fragment_lorem.xml
│ │ ├── fragment_name.xml
│ │ ├── fragment_number.xml
│ │ ├── fragment_phone.xml
│ │ ├── fragment_profile.xml
│ │ ├── fragment_target_views.xml
│ │ ├── fragment_url.xml
│ │ ├── fragment_widgets.xml
│ │ ├── header_drawer.xml
│ │ └── view_loading.xml
│ ├── menu/
│ │ └── menu_main.xml
│ ├── values/
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ ├── values-v21/
│ │ └── styles.xml
│ └── values-w820dp/
│ └── dimens.xml
├── build.gradle
├── faker-core/
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── io/
│ │ └── kimo/
│ │ └── lib/
│ │ └── faker/
│ │ └── component/
│ │ ├── number/
│ │ │ └── NumberComponentTest.java
│ │ └── text/
│ │ ├── AddressComponentTest.java
│ │ ├── InternetComponentTest.java
│ │ ├── LoremComponentTest.java
│ │ ├── NameComponentTest.java
│ │ ├── PhoneComponentTest.java
│ │ └── UrlComponentTest.java
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── io/
│ │ └── kimo/
│ │ └── lib/
│ │ └── faker/
│ │ ├── Faker.java
│ │ ├── FakerCoreComponent.java
│ │ ├── api/
│ │ │ ├── AddressAPI.java
│ │ │ ├── ColorAPI.java
│ │ │ ├── InternetAPI.java
│ │ │ ├── LoremAPI.java
│ │ │ ├── NameAPI.java
│ │ │ ├── NumberAPI.java
│ │ │ ├── PhoneAPI.java
│ │ │ └── UrlAPI.java
│ │ └── component/
│ │ ├── FakerColorComponent.java
│ │ ├── FakerNumericComponent.java
│ │ ├── FakerTextComponent.java
│ │ ├── number/
│ │ │ ├── ColorComponent.java
│ │ │ └── NumberComponent.java
│ │ └── text/
│ │ ├── AddressComponent.java
│ │ ├── InternetComponent.java
│ │ ├── LoremComponent.java
│ │ ├── NameComponent.java
│ │ ├── PhoneComponent.java
│ │ └── URLComponent.java
│ └── res/
│ └── values/
│ ├── address.xml
│ ├── internet.xml
│ ├── lorem.xml
│ ├── names.xml
│ ├── phones.xml
│ └── strings.xml
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── maven_push.gradle
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
# Gradle files
.gradle/
build/
/*/build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
*.iml
.idea/
.DS_Store
================================================
FILE: .travis.yml
================================================
language: android
jdk: oraclejdk7
env:
global:
- ADB_INSTALL_TIMEOUT=8
env:
matrix:
- ANDROID_TARGET=10 ANDROID_ABI=default/armeabi
- ANDROID_TARGET=21 ANDROID_ABI=default/armeabi-v7a
android:
components:
- android-22
- build-tools-22.0.1
- extra-android-m2repository
before_script:
- echo no | android create avd --force -n test -t android-$ANDROID_TARGET --abi $ANDROID_ABI
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./gradlew clean assemble -PdisablePreDex -q
- ./gradlew connectedAndroidTest
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
================================================
FILE: README.md
================================================
# Faker
[](https://android-arsenal.com/details/1/2039)
[](https://travis-ci.org/thiagokimo/Faker)
Faker provides fake data to your Android MPVs. Now it's very handy to make screenshots of your apps without worrying with Google Play copyright infringments, e.g [this app](https://play.google.com/store/apps/details?id=io.kimo.tmdb). Faker helps you to populate your views with random data quickly and painlessly.
## Screenshots


## Demo
The sample application (the source is in the **app** folder) has been published on Google Play to facilitate the access:
[](https://play.google.com/store/apps/details?id=io.kimo.faker)
The demo app has a very clean MVP architecture based in the idea of [this post](http://fernandocejas.com/2014/09/03/architecting-android-the-clean-way/). Feel free to give me suggestions.
## Setup
Gradle:
Add the JitPack repository to your build file:
``` groovy
repositories {
maven {
url "https://jitpack.io"
}
}
```
Add the dependency in the form:
``` groovy
dependencies {
compile 'com.github.thiagokimo:faker:VERSION'
}
```
Maven:
If you use Maven, add this into your build file:
``` xml
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
```
``` xml
<dependency>
<groupId>com.github.thiagokimo</groupId>
<artifactId>faker</artifactId>
<version>VERSION</version>
</dependency>
```
## Usage
### The "lazy" way
``` java
Faker.with(context)
.fill(rootView);
```
Faker will figure out all views inside the one you passed to it and fill it with proper data. Just like that!
By default faker will fill **TextViews** with lorem ipsum, **ImageViews** with a random color, **CompoundButtons** with a random state (check or uncheck) and **ProgressBars** with a random progress value.
### The specific way
``` java
Faker.with(context)
.NameOfTheComponent
.componentMethod();
```
### Targeting views
If you want Faker to fill specific views inside your ViewGroup you can pass your target views like the example below
``` java
Faker.with(context)
.targetViews(collection-of-ids)
.fill(rootView);
```
Check out all examples [here](https://github.com/thiagokimo/Faker/tree/master/app/src/main/java/io/kimo/faker/mvp/presenter).
## Components
Faker is organized in components that provides you specific types of data. Here is a list of the current components:
* [Lorem](https://github.com/thiagokimo/Faker/blob/master/faker-core/src/main/java/io/kimo/lib/faker/component/text/LoremComponent.java) - The old good lorem ispum words, sentences and paragraphs.
* [Name](https://github.com/thiagokimo/Faker/blob/master/faker-core/src/main/java/io/kimo/lib/faker/component/text/NameComponent.java) - Firsts, lasts, full and complete names and profession/titles.
* [Number](https://github.com/thiagokimo/Faker/blob/master/faker-core/src/main/java/io/kimo/lib/faker/component/number/NumberComponent.java) - It gives you numbers ¬¬
* [Phone](https://github.com/thiagokimo/Faker/blob/master/faker-core/src/main/java/io/kimo/lib/faker/component/text/PhoneComponent.java) - Phone masks \o/
* [Internet](https://github.com/thiagokimo/Faker/blob/master/faker-core/src/main/java/io/kimo/lib/faker/component/text/InternetComponent.java) - It provides you random emails and domains.
* [Url](https://github.com/thiagokimo/Faker/blob/master/faker-core/src/main/java/io/kimo/lib/faker/component/text/URLComponent.java) - Gives you (valid) urls that you might use somewhere.
* [Color](https://github.com/thiagokimo/Faker/blob/master/faker-core/src/main/java/io/kimo/lib/faker/component/number/ColorComponent.java) - Generates attractive colors thanks to [lzyzsd](https://github.com/lzyzsd/AndroidRandomColor)!
* [Address](https://github.com/thiagokimo/Faker/blob/master/faker-core/src/main/java/io/kimo/lib/faker/component/text/AddressComponent.java) - Gives random cities, countries, zipcodes, states and so on.
## Contribuiting
1. Fork it
2. Create your feature/bug-fix branch(`git checkout -b my-new-feature-or-fix`)
3. Commit your changes (`git commit -am 'Add some feature/fix'`)
4. Do your pull-request
Make sure you write tests for your code. Only code with passing tests will be accepted.
### Components
You can add more components or improve the existing ones. For new components, make sure you also add an example in the demo app.
### Localization
You can help providing localized data to Faker components.
## License
Copyright 2011, 2012 Thiago Rocha
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.
================================================
FILE: app/.gitignore
================================================
/build
================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '26.0.0'
defaultConfig {
applicationId "io.kimo.faker"
minSdkVersion 14
targetSdkVersion 22
versionCode 8
versionName "1.0.7"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile('com.mikepenz:materialdrawer:3.0.8@aar') { transitive = true }
compile('com.mikepenz:aboutlibraries:5.0.5@aar') { transitive = true }
compile 'com.squareup.picasso:picasso:2.5.2'
compile project(':faker-core')
}
================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/Kimo/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.kimo.faker" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".FakerApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:screenOrientation="portrait"
android:name=".ui.activity.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
================================================
FILE: app/src/main/java/io/kimo/faker/FakerApp.java
================================================
package io.kimo.faker;
import android.app.Application;
public class FakerApp extends Application {
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/BasePresenter.java
================================================
package io.kimo.faker.mvp;
import android.content.Context;
public abstract class BasePresenter implements Presenter {
protected View view;
protected Context context;
public BasePresenter(View view, Context context) {
this.view = view;
this.context = context;
}
@Override
public void createView() {
hideAllViews();
view.showLoading();
configureMainView();
view.hideLoading();
view.showView();
}
public void hideAllViews() {
view.hideView();
view.hideLoading();
}
public abstract void configureMainView();
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/BaseView.java
================================================
package io.kimo.faker.mvp;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public abstract class BaseView extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(getLayoutResource(), container, false);
mapGUI(view);
configureGUI();
return view;
}
@Override
public void onStart() {
super.onStart();
startPresenter();
}
@Override
public void onStop() {
super.onStop();
stopPresenter();
}
public abstract int getLayoutResource();
public abstract void mapGUI(View view);
public abstract void configureGUI();
public abstract void startPresenter();
public abstract void stopPresenter();
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/Presenter.java
================================================
package io.kimo.faker.mvp;
public interface Presenter {
void createView();
void destroyView();
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/View.java
================================================
package io.kimo.faker.mvp;
public interface View {
void showFeedback(String msg);
void showView();
void hideView();
void showLoading();
void hideLoading();
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/AddressPresenter.java
================================================
package io.kimo.faker.mvp.presenter;
import android.content.Context;
import io.kimo.faker.mvp.BasePresenter;
import io.kimo.faker.mvp.view.AddressView;
import io.kimo.lib.faker.Faker;
public class AddressPresenter extends BasePresenter{
public AddressPresenter(AddressView view, Context context) {
super(view, context);
}
@Override
public void configureMainView() {
AddressView addressView = (AddressView) view;
addressView.updateCityExample(Faker.with(context).Address.city());
addressView.updateStreetExample(Faker.with(context).Address.street());
addressView.updateSecondaryAddressExample(Faker.with(context).Address.secondaryAddress());
addressView.updateZipcodeExample(Faker.with(context).Address.zipCode());
addressView.updateTimezoneExample(Faker.with(context).Address.timeZone());
addressView.updateCityPrefixExample(Faker.with(context).Address.cityPrefix());
addressView.updateCitySuffixExample(Faker.with(context).Address.citySuffix());
addressView.updateStateExample(Faker.with(context).Address.state());
addressView.updateStateAbbrvExample(Faker.with(context).Address.stateAbbreviation());
addressView.updateCountryExample(Faker.with(context).Address.country());
addressView.updateCountryAbbrvExample(Faker.with(context).Address.countryAbbreviation());
addressView.updateLatitudeExample(Faker.with(context).Address.latitude());
addressView.updateLongitudeExample(Faker.with(context).Address.longitude());
}
@Override
public void destroyView() {
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/ColorPresenter.java
================================================
package io.kimo.faker.mvp.presenter;
import android.content.Context;
import io.kimo.faker.mvp.BasePresenter;
import io.kimo.faker.mvp.view.ColorView;
import io.kimo.lib.faker.Faker;
public class ColorPresenter extends BasePresenter{
public ColorPresenter(ColorView view, Context context) {
super(view, context);
}
@Override
public void configureMainView() {
ColorView colorView = (ColorView) view;
colorView.updateRandomColorExample(Faker.with(context).Color.randomColor());
colorView.updateRedColorExample(Faker.with(context).Color.redColor());
colorView.updateGreenColorExample(Faker.with(context).Color.greenColor());
colorView.updateBlueColorExample(Faker.with(context).Color.blueColor());
colorView.updateMonochromeColorExample(Faker.with(context).Color.monochromeColor());
colorView.updateBrightColorExample(Faker.with(context).Color.brightColor());
colorView.updateDarkColorExample(Faker.with(context).Color.darkColor());
colorView.updateLightColorExample(Faker.with(context).Color.lightColor());
}
@Override
public void destroyView() {
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/InternetPresenter.java
================================================
package io.kimo.faker.mvp.presenter;
import android.content.Context;
import io.kimo.faker.mvp.BasePresenter;
import io.kimo.faker.mvp.view.InternetView;
import io.kimo.lib.faker.Faker;
public class InternetPresenter extends BasePresenter{
public InternetPresenter(InternetView view, Context context) {
super(view, context);
}
@Override
public void configureMainView() {
InternetView internetView = (InternetView) view;
internetView.updateEmailExample(Faker.with(context).Internet.email());
internetView.updateURLExample(Faker.with(context).Internet.url());
internetView.updateDomainExample(Faker.with(context).Internet.domain());
internetView.updateDomainSuffixExample(Faker.with(context).Internet.domainSuffix());
}
@Override
public void destroyView() {}
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/LoremPresenter.java
================================================
package io.kimo.faker.mvp.presenter;
import android.content.Context;
import io.kimo.faker.mvp.BasePresenter;
import io.kimo.faker.mvp.view.LoremView;
import io.kimo.lib.faker.Faker;
public class LoremPresenter extends BasePresenter {
public LoremPresenter(LoremView view, Context context) {
super(view, context);
}
@Override
public void configureMainView() {
LoremView loremView = (LoremView) view;
loremView.updateCharacterExample(Faker.with(context).Lorem.character());
loremView.updateCharactersExample(Faker.with(context).Lorem.characters());
loremView.updateWordExample(Faker.with(context).Lorem.word());
loremView.updateWordsExample(Faker.with(context).Lorem.words());
loremView.updateSentenceExample(Faker.with(context).Lorem.sentence());
loremView.updateSentencesExample(Faker.with(context).Lorem.sentences());
loremView.updateParagraphExample(Faker.with(context).Lorem.paragraph());
loremView.updateParagraphsExample(Faker.with(context).Lorem.paragraphs());
}
@Override
public void destroyView() {}
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/NamePresenter.java
================================================
package io.kimo.faker.mvp.presenter;
import android.content.Context;
import io.kimo.faker.mvp.BasePresenter;
import io.kimo.faker.mvp.view.NameView;
import io.kimo.lib.faker.Faker;
public class NamePresenter extends BasePresenter {
public NamePresenter(NameView view, Context context) {
super(view, context);
}
@Override
public void configureMainView() {
NameView nameView = (NameView) view;
nameView.updateCompleteNameExample(Faker.with(context).Name.completeName());
nameView.updateFullNameExample(Faker.with(context).Name.fullName());
nameView.updateFirstNameExample(Faker.with(context).Name.firstName());
nameView.updateLastNameExample(Faker.with(context).Name.lastName());
nameView.updatePrefixExample(Faker.with(context).Name.prefix());
nameView.updateSuffixExample(Faker.with(context).Name.suffix());
nameView.updateTitleExample(Faker.with(context).Name.title());
}
@Override
public void destroyView() {}
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/NumberPresenter.java
================================================
package io.kimo.faker.mvp.presenter;
import android.content.Context;
import io.kimo.faker.mvp.BasePresenter;
import io.kimo.faker.mvp.view.NumberView;
import io.kimo.lib.faker.Faker;
public class NumberPresenter extends BasePresenter {
public NumberPresenter(NumberView view, Context context) {
super(view, context);
}
@Override
public void configureMainView() {
NumberView numberView = (NumberView) view;
numberView.updateDigit(Faker.with(context).Number.digit());
numberView.updatePositiveDigit(Faker.with(context).Number.positiveDigit());
numberView.updateNegativeDigit(Faker.with(context).Number.negativeDigit());
numberView.updateNumbers(Faker.with(context).Number.number());
numberView.updatePositiveNumbers(Faker.with(context).Number.positiveNumber());
numberView.updateNegativeNumbers(Faker.with(context).Number.negativeNumber());
}
@Override
public void destroyView() {}
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/PhonePresenter.java
================================================
package io.kimo.faker.mvp.presenter;
import android.content.Context;
import io.kimo.faker.mvp.BasePresenter;
import io.kimo.faker.mvp.View;
import io.kimo.faker.mvp.view.PhoneView;
import io.kimo.lib.faker.Faker;
public class PhonePresenter extends BasePresenter {
public PhonePresenter(View view, Context context) {
super(view, context);
}
@Override
public void configureMainView() {
PhoneView phoneView = (PhoneView) view;
phoneView.updatePhoneWithAreaCodeExample(Faker.with(context).Phone.phoneWithAreaCode());
phoneView.updatePhoneWithCountryCodeExample(Faker.with(context).Phone.phoneWithCountryCode());
}
@Override
public void destroyView() {}
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/UrlPresenter.java
================================================
package io.kimo.faker.mvp.presenter;
import android.content.Context;
import io.kimo.faker.mvp.BasePresenter;
import io.kimo.faker.mvp.view.UrlView;
import io.kimo.lib.faker.Faker;
public class UrlPresenter extends BasePresenter{
public UrlPresenter(UrlView view, Context context) {
super(view, context);
}
@Override
public void configureMainView() {
UrlView urlView = (UrlView) view;
urlView.updateImageUrlExample(Faker.with(context).Url.image());
urlView.updateAvatarUrlExample(Faker.with(context).Url.avatar());
}
@Override
public void destroyView() {
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/view/AddressView.java
================================================
package io.kimo.faker.mvp.view;
import io.kimo.faker.mvp.View;
public interface AddressView extends View {
void updateCityExample(String value);
void updateStreetExample(String value);
void updateSecondaryAddressExample(String value);
void updateZipcodeExample(String value);
void updateTimezoneExample(String value);
void updateCityPrefixExample(String value);
void updateCitySuffixExample(String value);
void updateStateExample(String value);
void updateStateAbbrvExample(String value);
void updateCountryExample(String value);
void updateCountryAbbrvExample(String value);
void updateLatitudeExample(String value);
void updateLongitudeExample(String value);
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/view/ColorView.java
================================================
package io.kimo.faker.mvp.view;
import io.kimo.faker.mvp.View;
public interface ColorView extends View {
void updateRandomColorExample(int color);
void updateRedColorExample(int color);
void updateGreenColorExample(int color);
void updateBlueColorExample(int color);
void updateMonochromeColorExample(int color);
void updateBrightColorExample(int color);
void updateLightColorExample(int color);
void updateDarkColorExample(int color);
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/view/InternetView.java
================================================
package io.kimo.faker.mvp.view;
import io.kimo.faker.mvp.View;
public interface InternetView extends View {
void updateEmailExample(String value);
void updateURLExample(String value);
void updateDomainExample(String value);
void updateDomainSuffixExample(String value);
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/view/LoremView.java
================================================
package io.kimo.faker.mvp.view;
import io.kimo.faker.mvp.View;
public interface LoremView extends View {
void updateCharacterExample(String value);
void updateCharactersExample(String value);
void updateWordExample(String value);
void updateWordsExample(String value);
void updateSentenceExample(String value);
void updateSentencesExample(String value);
void updateParagraphExample(String value);
void updateParagraphsExample(String value);
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/view/NameView.java
================================================
package io.kimo.faker.mvp.view;
import io.kimo.faker.mvp.View;
public interface NameView extends View {
void updateCompleteNameExample(String value);
void updateFullNameExample(String value);
void updateFirstNameExample(String value);
void updateLastNameExample(String value);
void updatePrefixExample(String value);
void updateSuffixExample(String value);
void updateTitleExample(String value);
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/view/NumberView.java
================================================
package io.kimo.faker.mvp.view;
import io.kimo.faker.mvp.View;
public interface NumberView extends View {
void updateDigit(int value);
void updatePositiveDigit(int value);
void updateNegativeDigit(int value);
void updateNumbers(int value);
void updatePositiveNumbers(int value);
void updateNegativeNumbers(int value);
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/view/PhoneView.java
================================================
package io.kimo.faker.mvp.view;
import io.kimo.faker.mvp.View;
public interface PhoneView extends View {
void updatePhoneWithAreaCodeExample(String value);
void updatePhoneWithCountryCodeExample(String value);
}
================================================
FILE: app/src/main/java/io/kimo/faker/mvp/view/UrlView.java
================================================
package io.kimo.faker.mvp.view;
import io.kimo.faker.mvp.View;
public interface UrlView extends View {
void updateImageUrlExample(String value);
void updateAvatarUrlExample(String value);
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/activity/MainActivity.java
================================================
package io.kimo.faker.ui.activity;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ScrollView;
import com.mikepenz.aboutlibraries.Libs;
import com.mikepenz.aboutlibraries.LibsBuilder;
import com.mikepenz.google_material_typeface_library.GoogleMaterial;
import com.mikepenz.iconics.IconicsDrawable;
import com.mikepenz.materialdrawer.Drawer;
import com.mikepenz.materialdrawer.DrawerBuilder;
import com.mikepenz.materialdrawer.model.PrimaryDrawerItem;
import com.mikepenz.materialdrawer.model.SectionDrawerItem;
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
import io.kimo.faker.R;
import io.kimo.faker.ui.fragment.AddressFragment;
import io.kimo.faker.ui.fragment.ColorFragment;
import io.kimo.faker.ui.fragment.InternetFragment;
import io.kimo.faker.ui.fragment.LoremFragment;
import io.kimo.faker.ui.fragment.NameFragment;
import io.kimo.faker.ui.fragment.NumberFragment;
import io.kimo.faker.ui.fragment.PhoneFragment;
import io.kimo.faker.ui.fragment.ProfileFragment;
import io.kimo.faker.ui.fragment.TargetViewsFragment;
import io.kimo.faker.ui.fragment.UrlFragment;
import io.kimo.faker.ui.fragment.WidgetsFragment;
public class MainActivity extends AppCompatActivity {
public static final int LOREM_FRAGMENT = 0;
public static final int NAME_FRAGMENT = 1;
public static final int NUMBER_FRAGMENT = 2;
public static final int PHONE_FRAGMENT = 3;
public static final int INTERNET_FRAGMENT = 4;
public static final int URL_FRAGMENT = 5;
public static final int PROFILE_FRAGMENT = 6;
public static final int RANDOM_WIDGETS_FRAGMENT = 7;
public static final int COLOR_FRAGMENT = 8;
public static final int ADDRESS_FRAGMENT = 9;
public static final int TARGET_VIEWS_FRAGMENT = 10;
private Toolbar toolbar;
private Drawer drawer;
private ScrollView scrollView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_with_toolbar);
configureToolbar();
configureDrawer(savedInstanceState);
if(savedInstanceState == null) {
showFragment(RANDOM_WIDGETS_FRAGMENT);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_main, menu);
MenuItem menuItem = menu.findItem(R.id.action_about);
menuItem.setIcon(new IconicsDrawable(this, GoogleMaterial.Icon.gmd_info_outline).actionBar().color(Color.WHITE));
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_about:
new LibsBuilder()
.withFields(R.string.class.getFields())
.withAutoDetect(true)
.withAboutIconShown(true)
.withAboutVersionShownName(true)
.withAboutAppName("Faker")
.withAboutDescription("Provides fake data to your Android apps.")
.withActivityTitle("About")
.withActivityTheme(R.style.AppTheme)
.withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR)
.start(this);
return true;
}
return super.onOptionsItemSelected(item);
}
private void configureToolbar() {
toolbar = (Toolbar) findViewById(R.id.toolbar);
if(toolbar != null) {
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
private void configureDrawer(Bundle savedInstanceState) {
drawer = new DrawerBuilder()
.withActivity(this)
.withHeader(R.layout.header_drawer)
.withToolbar(toolbar)
.withTranslucentStatusBar(true)
.addDrawerItems(
new PrimaryDrawerItem().withName("Random data").withIdentifier(RANDOM_WIDGETS_FRAGMENT),
new PrimaryDrawerItem().withName("Target views").withIdentifier(TARGET_VIEWS_FRAGMENT),
new PrimaryDrawerItem().withName("\"Specific\" random data").withIdentifier(PROFILE_FRAGMENT),
new SectionDrawerItem().withName("FAKER COMPONENTS"),
new PrimaryDrawerItem()
.withName("Lorem")
.withIcon(GoogleMaterial.Icon.gmd_text_format)
.withIconTintingEnabled(true)
.withIdentifier(LOREM_FRAGMENT),
new PrimaryDrawerItem()
.withName("Name")
.withIcon(GoogleMaterial.Icon.gmd_person)
.withIconTintingEnabled(true)
.withIdentifier(NAME_FRAGMENT),
new PrimaryDrawerItem()
.withName("Number")
.withIcon(GoogleMaterial.Icon.gmd_filter_9_plus)
.withIconTintingEnabled(true)
.withIdentifier(NUMBER_FRAGMENT),
new PrimaryDrawerItem()
.withName("Phone")
.withIcon(GoogleMaterial.Icon.gmd_call)
.withIconTintingEnabled(true)
.withIdentifier(PHONE_FRAGMENT),
new PrimaryDrawerItem()
.withName("Internet")
.withIcon(GoogleMaterial.Icon.gmd_public)
.withIconTintingEnabled(true)
.withIdentifier(INTERNET_FRAGMENT),
new PrimaryDrawerItem()
.withName("Url")
.withIcon(GoogleMaterial.Icon.gmd_photo)
.withIconTintingEnabled(true)
.withIdentifier(URL_FRAGMENT),
new PrimaryDrawerItem()
.withName("Color")
.withIcon(GoogleMaterial.Icon.gmd_invert_colors)
.withIconTintingEnabled(true)
.withIdentifier(COLOR_FRAGMENT),
new PrimaryDrawerItem()
.withName("Address")
.withIcon(GoogleMaterial.Icon.gmd_home)
.withIconTintingEnabled(true)
.withIdentifier(ADDRESS_FRAGMENT)
)
.withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
@Override
public boolean onItemClick(AdapterView<?> adapterView, View view, int i, long l, IDrawerItem iDrawerItem) {
if (iDrawerItem != null) {
showFragment(iDrawerItem.getIdentifier());
}
return false;
}
})
.withSelectedItem(0)
.withSavedInstance(savedInstanceState)
.build();
}
@Override
public void onBackPressed() {
if(drawer != null && drawer.isDrawerOpen()) {
drawer.closeDrawer();
} else {
super.onBackPressed();
}
}
private void showFragment(int flag) {
switch (flag) {
case LOREM_FRAGMENT:
replace(LoremFragment.newInstance());
break;
case NAME_FRAGMENT:
replace(NameFragment.newInstance());
break;
case NUMBER_FRAGMENT:
replace(NumberFragment.newInstance());
break;
case PHONE_FRAGMENT:
replace(PhoneFragment.newInstance());
break;
case INTERNET_FRAGMENT:
replace(InternetFragment.newInstance());
break;
case URL_FRAGMENT:
replace(UrlFragment.newInstance());
break;
case PROFILE_FRAGMENT:
replace(new ProfileFragment());
break;
case RANDOM_WIDGETS_FRAGMENT:
replace(new WidgetsFragment());
break;
case COLOR_FRAGMENT:
replace(ColorFragment.newInstance());
break;
case ADDRESS_FRAGMENT:
replace(AddressFragment.newInstance());
break;
case TARGET_VIEWS_FRAGMENT:
replace(new TargetViewsFragment());
break;
}
}
private void replace(Fragment fragment) {
if(scrollView == null) {
scrollView = (ScrollView) findViewById(R.id.container);
}
scrollView.fullScroll(ScrollView.FOCUS_UP);
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, fragment)
.commit();
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/fragment/AddressFragment.java
================================================
package io.kimo.faker.ui.fragment;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import io.kimo.faker.R;
import io.kimo.faker.mvp.BaseView;
import io.kimo.faker.mvp.presenter.AddressPresenter;
import io.kimo.faker.mvp.view.AddressView;
public class AddressFragment extends BaseView implements AddressView {
private AddressPresenter presenter;
private View mainView, loadingView;
private TextView city, street, secondaryAddress, zipcode, timezone, cityPrefix, citySuffix, state, stateAbbrv, country, countryAbbrv, latitude, longitude;
public static AddressFragment newInstance() {
return new AddressFragment();
}
@Override
public void updateCityExample(String value) {
city.setText(value);
}
@Override
public void updateStreetExample(String value) {
street.setText(value);
}
@Override
public void updateSecondaryAddressExample(String value) {
secondaryAddress.setText(value);
}
@Override
public void updateZipcodeExample(String value) {
zipcode.setText(value);
}
@Override
public void updateTimezoneExample(String value) {
timezone.setText(value);
}
@Override
public void updateCityPrefixExample(String value) {
cityPrefix.setText(value);
}
@Override
public void updateCitySuffixExample(String value) {
citySuffix.setText(value);
}
@Override
public void updateStateExample(String value) {
state.setText(value);
}
@Override
public void updateStateAbbrvExample(String value) {
stateAbbrv.setText(value);
}
@Override
public void updateCountryExample(String value) {
country.setText(value);
}
@Override
public void updateCountryAbbrvExample(String value) {
countryAbbrv.setText(value);
}
@Override
public void updateLatitudeExample(String value) {
latitude.setText(value);
}
@Override
public void updateLongitudeExample(String value) {
longitude.setText(value);
}
@Override
public int getLayoutResource() {
return R.layout.fragment_address;
}
@Override
public void mapGUI(View view) {
mainView = view.findViewById(R.id.main_container);
loadingView = view.findViewById(R.id.view_loading);
city = (TextView) mainView.findViewById(R.id.city);
street = (TextView) mainView.findViewById(R.id.street);
secondaryAddress = (TextView) mainView.findViewById(R.id.secondary_address);
zipcode = (TextView) mainView.findViewById(R.id.zipcode);
timezone = (TextView) mainView.findViewById(R.id.timezone);
cityPrefix = (TextView) mainView.findViewById(R.id.city_prefix);
citySuffix = (TextView) mainView.findViewById(R.id.city_suffix);
state = (TextView) mainView.findViewById(R.id.state);
stateAbbrv = (TextView) mainView.findViewById(R.id.state_abbrv);
country = (TextView) mainView.findViewById(R.id.country);
countryAbbrv = (TextView) mainView.findViewById(R.id.country_abbrv);
latitude = (TextView) mainView.findViewById(R.id.latitude);
longitude = (TextView) mainView.findViewById(R.id.longitude);
}
@Override
public void configureGUI() {
getActivity().setTitle("Address");
}
@Override
public void startPresenter() {
presenter = new AddressPresenter(this, getActivity());
presenter.createView();
}
@Override
public void stopPresenter() {
presenter.destroyView();
}
@Override
public void showFeedback(String msg) {
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT).show();
}
@Override
public void showView() {
mainView.setVisibility(View.VISIBLE);
}
@Override
public void hideView() {
mainView.setVisibility(View.GONE);
}
@Override
public void showLoading() {
loadingView.setVisibility(View.VISIBLE);
}
@Override
public void hideLoading() {
loadingView.setVisibility(View.GONE);
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/fragment/ColorFragment.java
================================================
package io.kimo.faker.ui.fragment;
import android.view.View;
import android.widget.Toast;
import io.kimo.faker.R;
import io.kimo.faker.mvp.BaseView;
import io.kimo.faker.mvp.presenter.ColorPresenter;
import io.kimo.faker.mvp.view.ColorView;
public class ColorFragment extends BaseView implements ColorView {
private View mainView, loadingView, random, red, green, blue, monochrome, bright, dark, light;
private ColorPresenter presenter;
public static ColorFragment newInstance() {
return new ColorFragment();
}
@Override
public int getLayoutResource() {
return R.layout.fragment_color;
}
@Override
public void mapGUI(View view) {
mainView = view.findViewById(R.id.main_container);
loadingView = view.findViewById(R.id.view_loading);
random = view.findViewById(R.id.random_color);
red = view.findViewById(R.id.red_color);
green = view.findViewById(R.id.green_color);
blue = view.findViewById(R.id.blue_color);
monochrome = view.findViewById(R.id.monochrome_color);
bright = view.findViewById(R.id.bright_color);
dark = view.findViewById(R.id.dark_color);
light = view.findViewById(R.id.light_color);
}
@Override
public void configureGUI() {
getActivity().setTitle("Color");
}
@Override
public void startPresenter() {
presenter = new ColorPresenter(this, getActivity());
presenter.createView();
}
@Override
public void stopPresenter() {
presenter.destroyView();
}
@Override
public void updateRandomColorExample(int color) {
random.setBackgroundColor(color);
}
@Override
public void updateRedColorExample(int color) {
red.setBackgroundColor(color);
}
@Override
public void updateGreenColorExample(int color) {
green.setBackgroundColor(color);
}
@Override
public void updateBlueColorExample(int color) {
blue.setBackgroundColor(color);
}
@Override
public void updateMonochromeColorExample(int color) {
monochrome.setBackgroundColor(color);
}
@Override
public void updateBrightColorExample(int color) {
bright.setBackgroundColor(color);
}
@Override
public void updateLightColorExample(int color) {
light.setBackgroundColor(color);
}
@Override
public void updateDarkColorExample(int color) {
dark.setBackgroundColor(color);
}
@Override
public void showFeedback(String msg) {
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT).show();
}
@Override
public void showView() {
mainView.setVisibility(View.VISIBLE);
}
@Override
public void hideView() {
mainView.setVisibility(View.GONE);
}
@Override
public void showLoading() {
loadingView.setVisibility(View.VISIBLE);
}
@Override
public void hideLoading() {
loadingView.setVisibility(View.GONE);
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/fragment/InternetFragment.java
================================================
package io.kimo.faker.ui.fragment;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import io.kimo.faker.R;
import io.kimo.faker.mvp.BaseView;
import io.kimo.faker.mvp.presenter.InternetPresenter;
import io.kimo.faker.mvp.view.InternetView;
public class InternetFragment extends BaseView implements InternetView {
private View mainView, loadingView;
private TextView email, url, domain, domainSuffix;
private InternetPresenter presenter;
public static InternetFragment newInstance() {
return new InternetFragment();
}
@Override
public int getLayoutResource() {
return R.layout.fragment_internet;
}
@Override
public void mapGUI(View view) {
mainView = view.findViewById(R.id.main_container);
loadingView = view.findViewById(R.id.view_loading);
email = (TextView) view.findViewById(R.id.email);
url = (TextView) view.findViewById(R.id.url);
domain = (TextView) view.findViewById(R.id.domain);
domainSuffix = (TextView) view.findViewById(R.id.domain_suffix);
}
@Override
public void configureGUI() {
getActivity().setTitle("Internet");
}
@Override
public void startPresenter() {
presenter = new InternetPresenter(this, getActivity());
presenter.createView();
}
@Override
public void stopPresenter() {
presenter.destroyView();
}
@Override
public void updateEmailExample(String value) {
email.setText(value);
}
@Override
public void updateURLExample(String value) {
url.setText(value);
}
@Override
public void updateDomainExample(String value) {
domain.setText(value);
}
@Override
public void updateDomainSuffixExample(String value) {
domainSuffix.setText(value);
}
@Override
public void showFeedback(String msg) {
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT).show();
}
@Override
public void showView() {
mainView.setVisibility(View.VISIBLE);
}
@Override
public void hideView() {
mainView.setVisibility(View.GONE);
}
@Override
public void showLoading() {
loadingView.setVisibility(View.VISIBLE);
}
@Override
public void hideLoading() {
loadingView.setVisibility(View.GONE);
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/fragment/LoremFragment.java
================================================
package io.kimo.faker.ui.fragment;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import io.kimo.faker.R;
import io.kimo.faker.mvp.BaseView;
import io.kimo.faker.mvp.presenter.LoremPresenter;
import io.kimo.faker.mvp.view.LoremView;
public class LoremFragment extends BaseView implements LoremView {
private View mainView, loadingView;
private TextView character, characters, word, words, sentence, sentences, paragraph, paragraphs;
private LoremPresenter presenter;
public static LoremFragment newInstance() {
return new LoremFragment();
}
@Override
public int getLayoutResource() {
return R.layout.fragment_lorem;
}
@Override
public void mapGUI(View view) {
mainView = view.findViewById(R.id.main_container);
loadingView = view.findViewById(R.id.view_loading);
character = (TextView) view.findViewById(R.id.lorem_character);
characters = (TextView) view.findViewById(R.id.lorem_characters);
word = (TextView) view.findViewById(R.id.lorem_word);
words = (TextView) view.findViewById(R.id.lorem_words);
sentence = (TextView) view.findViewById(R.id.lorem_sentence);
sentences = (TextView) view.findViewById(R.id.lorem_sentences);
paragraph = (TextView) view.findViewById(R.id.lorem_paragraph);
paragraphs = (TextView) view.findViewById(R.id.lorem_paragraphs);
}
@Override
public void configureGUI() {
getActivity().setTitle("Lorem");
}
@Override
public void startPresenter() {
presenter = new LoremPresenter(this, getActivity());
presenter.createView();
}
@Override
public void stopPresenter() {
presenter.destroyView();
}
@Override
public void updateCharacterExample(String value) {
character.setText(value);
}
@Override
public void updateCharactersExample(String value) {
characters.setText(value);
}
@Override
public void updateWordExample(String value) {
word.setText(value);
}
@Override
public void updateWordsExample(String value) {
words.setText(value);
}
@Override
public void updateSentenceExample(String value) {
sentence.setText(value);
}
@Override
public void updateSentencesExample(String value) {
sentences.setText(value);
}
@Override
public void updateParagraphExample(String value) {
paragraph.setText(value);
}
@Override
public void updateParagraphsExample(String value) {
paragraphs.setText(value);
}
@Override
public void showFeedback(String msg) {
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT).show();
}
@Override
public void showView() {
mainView.setVisibility(View.VISIBLE);
}
@Override
public void hideView() {
mainView.setVisibility(View.GONE);
}
@Override
public void showLoading() {
loadingView.setVisibility(View.VISIBLE);
}
@Override
public void hideLoading() {
loadingView.setVisibility(View.GONE);
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/fragment/NameFragment.java
================================================
package io.kimo.faker.ui.fragment;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import io.kimo.faker.R;
import io.kimo.faker.mvp.BaseView;
import io.kimo.faker.mvp.presenter.NamePresenter;
import io.kimo.faker.mvp.view.NameView;
public class NameFragment extends BaseView implements NameView {
private View mainView, loadingView;
private TextView completeName, fullName, firstName, lastName, prefix, suffix, title;
private NamePresenter presenter;
public static NameFragment newInstance() {
return new NameFragment();
}
@Override
public int getLayoutResource() {
return R.layout.fragment_name;
}
@Override
public void mapGUI(View view) {
mainView = view.findViewById(R.id.main_container);
loadingView = view.findViewById(R.id.view_loading);
completeName = (TextView) view.findViewById(R.id.complete_name);
fullName = (TextView) view.findViewById(R.id.full_name);
firstName = (TextView) view.findViewById(R.id.first_name);
lastName = (TextView) view.findViewById(R.id.last_name);
prefix = (TextView) view.findViewById(R.id.prefix);
suffix = (TextView) view.findViewById(R.id.suffix);
title = (TextView) view.findViewById(R.id.title);
}
@Override
public void configureGUI() {
getActivity().setTitle("Name");
}
@Override
public void startPresenter() {
presenter = new NamePresenter(this, getActivity());
presenter.createView();
}
@Override
public void stopPresenter() {
presenter.destroyView();
}
@Override
public void showFeedback(String msg) {
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT).show();
}
@Override
public void showView() {
mainView.setVisibility(View.VISIBLE);
}
@Override
public void hideView() {
mainView.setVisibility(View.GONE);
}
@Override
public void showLoading() {
loadingView.setVisibility(View.VISIBLE);
}
@Override
public void hideLoading() {
loadingView.setVisibility(View.GONE);
}
@Override
public void updateCompleteNameExample(String value) {
completeName.setText(value);
}
@Override
public void updateFullNameExample(String value) {
fullName.setText(value);
}
@Override
public void updateFirstNameExample(String value) {
firstName.setText(value);
}
@Override
public void updateLastNameExample(String value) {
lastName.setText(value);
}
@Override
public void updatePrefixExample(String value) {
prefix.setText(value);
}
@Override
public void updateSuffixExample(String value) {
suffix.setText(value);
}
@Override
public void updateTitleExample(String value) {
title.setText(value);
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/fragment/NumberFragment.java
================================================
package io.kimo.faker.ui.fragment;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import io.kimo.faker.R;
import io.kimo.faker.mvp.BaseView;
import io.kimo.faker.mvp.presenter.NumberPresenter;
import io.kimo.faker.mvp.view.NumberView;
public class NumberFragment extends BaseView implements NumberView {
private View mainView, loadingView;
private TextView digit, positiveDigit, negativeDigit, numbers, positiveNumbers, negativeNumbers;
private NumberPresenter presenter;
public static NumberFragment newInstance() {
return new NumberFragment();
}
@Override
public int getLayoutResource() {
return R.layout.fragment_number;
}
@Override
public void mapGUI(View view) {
mainView = view.findViewById(R.id.main_container);
loadingView = view.findViewById(R.id.view_loading);
digit = (TextView) view.findViewById(R.id.digit);
positiveDigit = (TextView) view.findViewById(R.id.positive_digit);
negativeDigit = (TextView) view.findViewById(R.id.negative_digit);
numbers = (TextView) view.findViewById(R.id.number);
positiveNumbers = (TextView) view.findViewById(R.id.positive_number);
negativeNumbers = (TextView) view.findViewById(R.id.negative_number);
}
@Override
public void configureGUI() {
getActivity().setTitle("Numbers");
}
@Override
public void startPresenter() {
presenter = new NumberPresenter(this, getActivity());
presenter.createView();
}
@Override
public void stopPresenter() {
presenter.destroyView();
}
@Override
public void showFeedback(String msg) {
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT).show();
}
@Override
public void showView() {
mainView.setVisibility(View.VISIBLE);
}
@Override
public void hideView() {
mainView.setVisibility(View.GONE);
}
@Override
public void showLoading() {
loadingView.setVisibility(View.VISIBLE);
}
@Override
public void hideLoading() {
loadingView.setVisibility(View.GONE);
}
@Override
public void updateDigit(int value) {
digit.setText(String.valueOf(value));
}
@Override
public void updatePositiveDigit(int value) {
positiveDigit.setText(String.valueOf(value));
}
@Override
public void updateNegativeDigit(int value) {
negativeDigit.setText(String.valueOf(value));
}
@Override
public void updateNumbers(int value) {
numbers.setText(String.valueOf(value));
}
@Override
public void updatePositiveNumbers(int value) {
positiveNumbers.setText(String.valueOf(value));
}
@Override
public void updateNegativeNumbers(int value) {
negativeNumbers.setText(String.valueOf(value));
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/fragment/PhoneFragment.java
================================================
package io.kimo.faker.ui.fragment;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import io.kimo.faker.R;
import io.kimo.faker.mvp.BaseView;
import io.kimo.faker.mvp.presenter.PhonePresenter;
import io.kimo.faker.mvp.view.PhoneView;
public class PhoneFragment extends BaseView implements PhoneView {
private View mainView, loadingView;
private TextView areaCode, countryCode;
private PhonePresenter presenter;
public static PhoneFragment newInstance() {
return new PhoneFragment();
}
@Override
public int getLayoutResource() {
return R.layout.fragment_phone;
}
@Override
public void mapGUI(View view) {
mainView = view.findViewById(R.id.main_container);
loadingView = view.findViewById(R.id.view_loading);
areaCode = (TextView) view.findViewById(R.id.area_code_phone);
countryCode = (TextView) view.findViewById(R.id.country_code_phone);
}
@Override
public void configureGUI() {
getActivity().setTitle("Phone");
}
@Override
public void startPresenter() {
presenter = new PhonePresenter(this, getActivity());
presenter.createView();
}
@Override
public void stopPresenter() {
presenter.destroyView();
}
@Override
public void updatePhoneWithAreaCodeExample(String value) {
areaCode.setText(value);
}
@Override
public void updatePhoneWithCountryCodeExample(String value) {
countryCode.setText(value);
}
@Override
public void showFeedback(String msg) {
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT).show();
}
@Override
public void showView() {
mainView.setVisibility(View.VISIBLE);
}
@Override
public void hideView() {
mainView.setVisibility(View.GONE);
}
@Override
public void showLoading() {
loadingView.setVisibility(View.VISIBLE);
}
@Override
public void hideLoading() {
loadingView.setVisibility(View.GONE);
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/fragment/ProfileFragment.java
================================================
package io.kimo.faker.ui.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import io.kimo.faker.R;
import io.kimo.lib.faker.Faker;
public class ProfileFragment extends Fragment {
private ImageView image;
private TextView name, title, website, email, phone;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_profile, container, false);
image = (ImageView) view.findViewById(R.id.image);
name = (TextView) view.findViewById(R.id.name);
title = (TextView) view.findViewById(R.id.title);
website = (TextView) view.findViewById(R.id.website);
email = (TextView) view.findViewById(R.id.email);
phone = (TextView) view.findViewById(R.id.phone);
return view;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Picasso.with(getActivity())
.load(Faker.with(getActivity()).Url.avatar())
.placeholder(R.drawable.drawer_background)
.error(R.drawable.drawer_background)
.into(image);
name.setText(Faker.with(getActivity()).Name.fullName());
title.setText(Faker.with(getActivity()).Name.title());
website.setText(Faker.with(getActivity()).Internet.url());
email.setText(Faker.with(getActivity()).Internet.email());
phone.setText(Faker.with(getActivity()).Phone.phoneWithAreaCode());
getActivity().setTitle("\"Specific\" Random Data");
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/fragment/TargetViewsFragment.java
================================================
package io.kimo.faker.ui.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import io.kimo.faker.R;
import io.kimo.lib.faker.Faker;
public class TargetViewsFragment extends Fragment {
View rootView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_target_views, container, false);
return rootView;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getActivity().setTitle("Target Views");
Faker.with(getActivity())
.targetViews(R.id.text, R.id.image, R.id.button)
.fill(rootView);
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/fragment/UrlFragment.java
================================================
package io.kimo.faker.ui.fragment;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.squareup.picasso.MemoryPolicy;
import com.squareup.picasso.Picasso;
import io.kimo.faker.R;
import io.kimo.faker.mvp.BaseView;
import io.kimo.faker.mvp.presenter.UrlPresenter;
import io.kimo.faker.mvp.view.UrlView;
public class UrlFragment extends BaseView implements UrlView {
private View mainView, loadingView;
private TextView imageUrl, avatarUrl;
private ImageView image, avatar;
private UrlPresenter presenter;
public static UrlFragment newInstance() {
return new UrlFragment();
}
@Override
public int getLayoutResource() {
return R.layout.fragment_url;
}
@Override
public void mapGUI(View view) {
mainView = view.findViewById(R.id.main_container);
loadingView = view.findViewById(R.id.view_loading);
imageUrl = (TextView) view.findViewById(R.id.image_url);
image = (ImageView) view.findViewById(R.id.image);
avatarUrl = (TextView) view.findViewById(R.id.avatar_url);
avatar = (ImageView) view.findViewById(R.id.avatar);
}
@Override
public void configureGUI() {
getActivity().setTitle("Url");
}
@Override
public void startPresenter() {
presenter = new UrlPresenter(this, getActivity());
presenter.createView();
}
@Override
public void stopPresenter() {
presenter.destroyView();
}
@Override
public void updateImageUrlExample(String value) {
Picasso.with(getActivity())
.load(value)
.memoryPolicy(MemoryPolicy.NO_CACHE)
.placeholder(R.drawable.drawer_background)
.error(R.drawable.drawer_background)
.into(image);
imageUrl.setText(value);
}
@Override
public void updateAvatarUrlExample(String value) {
Picasso.with(getActivity())
.load(value)
.memoryPolicy(MemoryPolicy.NO_CACHE)
.placeholder(R.drawable.drawer_background)
.error(R.drawable.drawer_background)
.into(avatar);
avatarUrl.setText(value);
}
@Override
public void showFeedback(String msg) {
Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT).show();
}
@Override
public void showView() {
mainView.setVisibility(View.VISIBLE);
}
@Override
public void hideView() {
mainView.setVisibility(View.GONE);
}
@Override
public void showLoading() {
loadingView.setVisibility(View.VISIBLE);
}
@Override
public void hideLoading() {
loadingView.setVisibility(View.GONE);
}
}
================================================
FILE: app/src/main/java/io/kimo/faker/ui/fragment/WidgetsFragment.java
================================================
package io.kimo.faker.ui.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import io.kimo.faker.R;
import io.kimo.lib.faker.Faker;
public class WidgetsFragment extends Fragment {
private View rootView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_widgets, container, false);
return rootView;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getActivity().setTitle("Random Data");
Faker.with(getActivity()).fill(rootView);
}
}
================================================
FILE: app/src/main/res/layout/activity_with_toolbar.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@+id/container"
android:layout_below="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
</RelativeLayout>
================================================
FILE: app/src/main/res/layout/fragment_address.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/main_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_horizontal_margin">
<TextView
android:text="City"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/city"
style="@style/DetailField"
tools:text="Belo Horizonte"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Street"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/street"
style="@style/DetailField"
tools:text="Cristovão Colombo Avenue"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Secondary Address"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/secondary_address"
style="@style/DetailField"
tools:text="14 Suite"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="ZipCode/Postcode"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/zipcode"
style="@style/DetailField"
tools:text="123456"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Timezone"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/timezone"
style="@style/DetailField"
tools:text="America/Sao_Paulo"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="City Prefix"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/city_prefix"
style="@style/DetailField"
tools:text="Lake"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="City Suffix"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/city_suffix"
style="@style/DetailField"
tools:text="Fort"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="State"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/state"
style="@style/DetailField"
tools:text="New York"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="State Abbreviation"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/state_abbrv"
style="@style/DetailField"
tools:text="NY"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Country"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/country"
style="@style/DetailField"
tools:text="Brazil"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Country Abbreviation"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/country_abbrv"
style="@style/DetailField"
tools:text="BR"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Latitude"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/latitude"
style="@style/DetailField"
tools:text="-123.45645456"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Longitude"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/longitude"
style="@style/DetailField"
tools:text="-123.45645456"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<include layout="@layout/view_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/fragment_color.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/main_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_horizontal_margin">
<TextView
android:text="Random Color"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<View
android:id="@+id/random_color"
android:layout_width="match_parent"
android:layout_height="40dp"/>
<TextView
android:text="Red Color"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<View
android:id="@+id/red_color"
android:layout_width="match_parent"
android:layout_height="40dp"/>
<TextView
android:text="Green Color"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<View
android:id="@+id/green_color"
android:layout_width="match_parent"
android:layout_height="40dp"/>
<TextView
android:text="Blue Color"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<View
android:id="@+id/blue_color"
android:layout_width="match_parent"
android:layout_height="40dp"/>
<TextView
android:text="Monochrome Color"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<View
android:id="@+id/monochrome_color"
android:layout_width="match_parent"
android:layout_height="40dp"/>
<TextView
android:text="Bright Color"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<View
android:id="@+id/bright_color"
android:layout_width="match_parent"
android:layout_height="40dp"/>
<TextView
android:text="Dark Color"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<View
android:id="@+id/dark_color"
android:layout_width="match_parent"
android:layout_height="40dp"/>
<TextView
android:text="Light Color"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<View
android:id="@+id/light_color"
android:layout_width="match_parent"
android:layout_height="40dp"/>
</LinearLayout>
<include layout="@layout/view_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/fragment_internet.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/main_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_horizontal_margin">
<TextView
android:text="Email"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/email"
style="@style/DetailField"
tools:text="kimo@kimo.io"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="URL"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/url"
style="@style/DetailField"
tools:text="http://kimo.io"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Domain"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/domain"
style="@style/DetailField"
tools:text="kimo"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Domain Suffix"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/domain_suffix"
style="@style/DetailField"
tools:text=".io"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<include layout="@layout/view_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/fragment_lorem.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/main_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_horizontal_margin">
<TextView
android:text="Character"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/lorem_character"
style="@style/DetailField"
tools:text="Y"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Characters"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/lorem_characters"
style="@style/DetailField"
tools:text="YYZ"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Word"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/lorem_word"
style="@style/DetailField"
tools:text="Lorem"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Words"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/lorem_words"
style="@style/DetailField"
tools:text="Lorem Ipsum Dolor"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Sentence"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/lorem_sentence"
style="@style/DetailField"
tools:text="Lorem Ipsum Dolor."
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Sentences"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/lorem_sentences"
style="@style/DetailField"
tools:text="Lorem Ipsum Dolor."
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Paragraph"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/lorem_paragraph"
style="@style/DetailField"
tools:text="Lorem Ipsum Dolor."
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Paragraphs"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/lorem_paragraphs"
style="@style/DetailField"
tools:text="Lorem Ipsum Dolor."
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<include layout="@layout/view_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/fragment_name.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/main_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_horizontal_margin">
<TextView
android:text="Complete Name"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/complete_name"
style="@style/DetailField"
tools:text="Mr. John Doe Jr."
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Full Name"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/full_name"
style="@style/DetailField"
tools:text="John Doe Sr."
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="First Name"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/first_name"
style="@style/DetailField"
tools:text="John"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Last Name"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/last_name"
style="@style/DetailField"
tools:text="Doe"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Prefix"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/prefix"
style="@style/DetailField"
tools:text="Mr."
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Suffix"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/suffix"
style="@style/DetailField"
tools:text="Jr."
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Title"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/title"
style="@style/DetailField"
tools:text="Senior Android Developer"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<include layout="@layout/view_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/fragment_number.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/main_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_horizontal_margin">
<TextView
android:text="Digit"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/digit"
style="@style/DetailField"
tools:text="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Positive Digit"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/positive_digit"
style="@style/DetailField"
tools:text="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Negative Digit"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/negative_digit"
style="@style/DetailField"
tools:text="-1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Number"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/number"
style="@style/DetailField"
tools:text="12345"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Positive Number"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/positive_number"
style="@style/DetailField"
tools:text="12345"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Negative Number"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/negative_number"
style="@style/DetailField"
tools:text="-12345"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<include layout="@layout/view_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/fragment_phone.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/main_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_horizontal_margin">
<TextView
android:text="Phone with Area Code"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/area_code_phone"
style="@style/DetailField"
tools:text="(###) ###-####"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="Phone with Country Code"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/country_code_phone"
style="@style/DetailField"
tools:text="##-###-####"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<include layout="@layout/view_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/fragment_profile.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="240dp" />
<TextView
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
tools:text="Thiago Rocha"
android:textSize="24sp"
android:textColor="@android:color/black"
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:id="@+id/title"
tools:text="Senior Android Developer"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:orientation="vertical"
android:layout_marginTop="8dp"
android:layout_width="match_parent"
android:layout_height="72dp">
<com.mikepenz.iconics.view.IconicsImageView
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:layout_width="24dp"
android:layout_height="24dp"
app:iiv_icon="gmd-public"
app:iiv_color="?attr/colorPrimary" />
<LinearLayout
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_marginLeft="72dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textSize="16sp"
android:textColor="@android:color/black"
tools:text="http://kimo.io"
android:id="@+id/website"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:text="Official Website"
android:textSize="14sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
<View
android:background="@color/divider"
android:layout_width="match_parent"
android:layout_height="1dp"/>
<RelativeLayout
android:orientation="vertical"
android:layout_marginTop="8dp"
android:layout_width="match_parent"
android:layout_height="72dp">
<com.mikepenz.iconics.view.IconicsImageView
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:layout_width="24dp"
android:layout_height="24dp"
app:iiv_icon="gmd-mail"
app:iiv_color="?attr/colorPrimary" />
<LinearLayout
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_marginLeft="72dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textSize="16sp"
android:textColor="@android:color/black"
tools:text="http://kimo.io"
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:text="Professional email"
android:textSize="14sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
<View
android:background="@color/divider"
android:layout_width="match_parent"
android:layout_height="1dp"/>
<RelativeLayout
android:orientation="vertical"
android:layout_marginTop="8dp"
android:layout_width="match_parent"
android:layout_height="72dp">
<com.mikepenz.iconics.view.IconicsImageView
android:layout_centerVertical="true"
android:layout_marginLeft="16dp"
android:layout_width="24dp"
android:layout_height="24dp"
app:iiv_icon="gmd-call"
app:iiv_color="?attr/colorPrimary" />
<LinearLayout
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_marginLeft="72dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textSize="16sp"
android:textColor="@android:color/black"
tools:text="(123) 456-7890"
android:id="@+id/phone"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:text="Mobile"
android:textSize="14sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/fragment_target_views.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<LinearLayout
android:padding="16dp"
android:layout_marginBottom="16dp"
android:background="@android:color/white"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:gravity="center"
android:layout_marginBottom="16dp"
android:text="This area contains views with content that cannot be changed"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:layout_marginBottom="16dp"
android:background="@android:color/holo_blue_light"
android:layout_width="match_parent"
android:layout_height="16dp" />
<Button
android:layout_marginBottom="16dp"
android:text="Button with a text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:padding="16dp"
android:background="@android:color/holo_orange_light"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/text"
android:gravity="center"
android:layout_marginBottom="16dp"
android:text="This area contains views with content that will be changed"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/image"
android:layout_marginBottom="16dp"
android:background="@android:color/holo_blue_light"
android:layout_width="match_parent"
android:layout_height="16dp" />
<Button
android:id="@+id/button"
android:layout_marginBottom="16dp"
android:text="Button with a text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/fragment_url.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/main_container"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_horizontal_margin">
<TextView
android:text="Image"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/image_url"
style="@style/DetailField"
tools:text="http://lorempixel.com/300/300"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:layout_marginTop="18dp"
android:id="@+id/image"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:text="Avatar"
style="@style/HeaderTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/avatar_url"
style="@style/DetailField"
tools:text="https://robohash.org/thiago"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageView
android:layout_marginTop="18dp"
android:id="@+id/avatar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<include layout="@layout/view_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/fragment_widgets.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/activity_horizontal_margin">
<LinearLayout
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="New Text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
tools:text="Large Text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:text="Medium Text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="Small Text" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_horizontal_margin">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="New Button" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="New RadioButton"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="New CheckBox"/>
<Switch
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Switch"
android:id="@+id/switch1" />
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="New ToggleButton" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="40dp" />
<ImageButton
android:layout_width="match_parent"
android:layout_height="40dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="40dp"/>
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<RatingBar
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/header_drawer.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="192dp"
android:minHeight="192dp"
android:background="@drawable/drawer_background"/>
================================================
FILE: app/src/main/res/layout/view_loading.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:visibility="gone"
android:id="@+id/view_loading">
<ProgressBar
android:indeterminate="true"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal" />
</LinearLayout>
================================================
FILE: app/src/main/res/menu/menu_main.xml
================================================
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.mikepenz.iconics.sample.MainActivity">
<item android:id="@+id/action_about"
android:title="About"
app:showAsAction="ifRoom"/>
</menu>
================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="faker_primary_color">#FF9800</color>
<color name="faker_secondary_color">#F57C00</color>
<color name="faker_accent_color">#03A9F4</color>
</resources>
================================================
FILE: app/src/main/res/values/dimens.xml
================================================
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
<string name="app_name">Faker</string>
<string name="open">Open</string>
<string name="close">Close</string>
</resources>
================================================
FILE: app/src/main/res/values/styles.xml
================================================
<resources>
<style name="AppTheme" parent="AppTheme.Base"/>
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/faker_primary_color</item>
<item name="colorPrimaryDark">@color/faker_secondary_color</item>
<item name="colorAccent">@color/faker_accent_color</item>
<item name="android:textColorPrimary">#212121</item>
</style>
<style name="HeaderTextView" parent="android:Widget.TextView">
<item name="android:gravity">center_vertical</item>
<item name="android:minHeight">48dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">?attr/colorPrimaryDark</item>
</style>
<style name="DetailField" parent="android:Widget.TextView">
<item name="android:gravity">center_vertical</item>
<item name="android:lineSpacingExtra">6dp</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
</resources>
================================================
FILE: app/src/main/res/values-v21/styles.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="AppTheme.Base">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
</resources>
================================================
FILE: app/src/main/res/values-w820dp/dimens.xml
================================================
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
================================================
FILE: faker-core/.gitignore
================================================
/build
================================================
FILE: faker-core/build.gradle
================================================
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion '26.0.1'
defaultConfig {
minSdkVersion 9
targetSdkVersion 22
versionName "1.4.4"
versionCode 10
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
unitTests.returnDefaultValues = true
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile ('com.github.lzyzsd.randomcolor:library:1.0.0') {
exclude group: "com.android.support", module: "appcompat-v7"
}
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'com.android.support.test:rules:0.3'
}
================================================
FILE: faker-core/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/Kimo/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
================================================
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/number/NumberComponentTest.java
================================================
package io.kimo.lib.faker.component.number;
import android.test.AndroidTestCase;
import org.junit.Before;
import org.junit.Test;
public class NumberComponentTest extends AndroidTestCase {
private NumberComponent numberComponent;
@Before
public void setUp() throws Exception {
numberComponent = new NumberComponent(getContext());
}
@Test
public void testDigit() throws Exception {
int randomDigit = numberComponent.digit();
assertTrue(randomDigit > -10 && randomDigit < 10);
}
@Test
public void testPositiveDigit() throws Exception {
int positiveDigit = numberComponent.positiveDigit();
assertTrue(positiveDigit >= 0 && positiveDigit < 10);
}
@Test
public void testNegativeDigit() throws Exception {
int negativeDigit = numberComponent.negativeDigit();
assertTrue(negativeDigit < 0 && negativeDigit > -10);
}
@Test
public void testNumbers() throws Exception {
try {
Integer.parseInt(numberComponent.number() + "");
assertTrue(true);
} catch (NumberFormatException e) {
assertTrue(false);
}
}
@Test
public void testNumbersWithArguments() throws Exception {
for(int i = 0; i < 10000; i++) {
String randomNumber = numberComponent.number(3) + "";
assertTrue(randomNumber.length() == 3);
}
}
@Test
public void testNumbersWithInvalidArguments() throws Exception {
try {
numberComponent.number(0);
assertTrue(false);
} catch (IllegalArgumentException e) {
assertTrue(true);
}
}
@Test
public void testPositiveNumbers() throws Exception {
int randomPositiveNumber = numberComponent.positiveNumber();
assertTrue(randomPositiveNumber > -1);
}
@Test
public void testNegativeNumbers() throws Exception {
int randomPositiveNumber = numberComponent.negativeNumber();
assertTrue(randomPositiveNumber < 0);
}
@Test
public void testRandomNumber() throws Exception {
assertTrue(numberComponent.randomNumber() instanceof Number);
}
}
================================================
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/AddressComponentTest.java
================================================
package io.kimo.lib.faker.component.text;
import android.test.AndroidTestCase;
import org.junit.Before;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import io.kimo.lib.faker.R;
public class AddressComponentTest extends AndroidTestCase {
private AddressComponent addressComponent;
private List<String> firstNames, lastNames, cityPrefixes, citySuffixes, streetSuffixes, secondaryAddressPrefixes, timezones, states, statesAbbrv, countries, countriesAbbrv;
@Before
public void setUp() throws Exception {
addressComponent = new AddressComponent(getContext());
firstNames = Arrays.asList(getContext().getResources().getStringArray(R.array.first_names));
lastNames = Arrays.asList(getContext().getResources().getStringArray(R.array.last_names));
cityPrefixes = Arrays.asList(getContext().getResources().getStringArray(R.array.city_prefixes));
citySuffixes = Arrays.asList(getContext().getResources().getStringArray(R.array.city_suffixes));
streetSuffixes = Arrays.asList(getContext().getResources().getStringArray(R.array.street_suffixes));
secondaryAddressPrefixes = Arrays.asList(getContext().getResources().getStringArray(R.array.secondary_address_prefixes));
timezones = Arrays.asList(getContext().getResources().getStringArray(R.array.timezone));
states = Arrays.asList(getContext().getResources().getStringArray(R.array.states));
statesAbbrv = Arrays.asList(getContext().getResources().getStringArray(R.array.states_abbrv));
countries = Arrays.asList(getContext().getResources().getStringArray(R.array.countries));
countriesAbbrv = Arrays.asList(getContext().getResources().getStringArray(R.array.countries_abbrv));
}
@Test
public void testCity() throws Exception {
for(int i = 0; i < 1000; i++) {
String city = addressComponent.city();
boolean containsFirstName = false;
boolean containsLastName = false;
boolean containsPrefix = false;
boolean containsSuffix = false;
for (String firstName : firstNames) {
if (city.contains(firstName)) {
containsFirstName = true;
}
}
for (String lastName : lastNames) {
if (city.contains(lastName)) {
containsLastName = true;
}
}
for (String prefix : cityPrefixes) {
if (city.contains(prefix)) {
containsPrefix = true;
}
}
for (String suffix : citySuffixes) {
if (city.contains(suffix)) {
containsSuffix = true;
}
}
assertTrue(containsFirstName || containsLastName);
assertTrue(containsPrefix || containsSuffix);
}
}
@Test
public void testStreet() throws Exception {
String streetName = addressComponent.street();
boolean containsFirstName = false;
boolean containsLastName = false;
boolean containsStreetSuffix = false;
for(String firstName : firstNames) {
if(streetName.contains(firstName)) {
containsFirstName = true;
}
}
for(String lastName : lastNames) {
if(streetName.contains(lastName)) {
containsLastName = true;
}
}
for(String streetSuffix : streetSuffixes) {
if(streetName.contains(streetSuffix)) {
containsStreetSuffix = true;
}
}
assertTrue( containsFirstName || containsLastName );
assertTrue( containsStreetSuffix );
}
@Test
public void testStreetWithNumber() throws Exception {
String streetNameWithNumber = addressComponent.streetWithNumber();
assertTrue(streetNameWithNumber.matches("\\d+ .+"));
}
@Test
public void testSecondaryAddress() throws Exception {
String secondaryAddress = addressComponent.secondaryAddress();
boolean containsSecondaryAddressPrefix = false;
for(String secondaryAddressPrefix : secondaryAddressPrefixes) {
if(secondaryAddress.contains(secondaryAddressPrefix)) {
containsSecondaryAddressPrefix = true;
}
}
assertTrue(containsSecondaryAddressPrefix);
}
@Test
public void testBuildingNumber() throws Exception {
String buildingNumber = addressComponent.buildingNumber();
assertTrue(buildingNumber.matches("\\d+"));
}
@Test
public void testZipCodeAndPostCode() throws Exception {
String zipCode = addressComponent.zipCode();
String postCode = addressComponent.postCode();
assertTrue(zipCode.matches("\\d{5}") || zipCode.matches("\\d{5}-\\d{4}"));
assertTrue(postCode.matches("\\d{5}") || postCode.matches("\\d{5}-\\d{4}"));
}
@Test
public void testTimeZone() throws Exception {
String randomTimezone = addressComponent.timeZone();
boolean containsTimezone = false;
for(String timezone : timezones) {
if(randomTimezone.equals(timezone)) {
containsTimezone = true;
}
}
assertTrue(containsTimezone);
}
@Test
public void testCitySuffix() throws Exception {
for(int i = 0 ; i < 1000; i++) {
assertTrue(citySuffixes.contains(addressComponent.citySuffix()));
}
}
@Test
public void testCityPrefix() throws Exception {
for(int i = 0; i < 1000; i++) {
assertTrue(cityPrefixes.contains(addressComponent.cityPrefix()));
}
}
@Test
public void testState() throws Exception {
String randomState = addressComponent.state();
boolean containsState = false;
for(String state : states) {
if(randomState.equals(state)) {
containsState = true;
}
}
assertTrue(containsState);
}
@Test
public void testStateAbbreviation() throws Exception {
String randomStateAbbrv = addressComponent.stateAbbreviation();
boolean containsStateAbbrv = false;
for(String abbrv : statesAbbrv) {
if(randomStateAbbrv.equals(abbrv)) {
containsStateAbbrv = true;
}
}
assertTrue(containsStateAbbrv);
}
@Test
public void testCountry() throws Exception {
String randomCountry = addressComponent.country();
boolean containsContry = false;
for(String country : countries) {
if(randomCountry.equals(country)) {
containsContry = true;
}
}
assertTrue(containsContry);
}
@Test
public void testCountryAbbreviation() throws Exception {
String randomCountryAbbrv = addressComponent.countryAbbreviation();
boolean containsCountryAbbrv = false;
for(String countryAbbrv : countriesAbbrv) {
if(randomCountryAbbrv.equals(countryAbbrv)) {
containsCountryAbbrv = true;
}
}
assertTrue(containsCountryAbbrv);
}
@Test
public void testLatitudeAndLongitude() throws Exception {
try {
Double.parseDouble(addressComponent.latitude());
Double.parseDouble(addressComponent.longitude());
assertTrue(true);
} catch (Exception e) {
assertTrue(false);
}
}
@Test
public void testRandomText() throws Exception {
assertTrue(addressComponent.randomText() instanceof String);
}
}
================================================
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/InternetComponentTest.java
================================================
package io.kimo.lib.faker.component.text;
import android.test.AndroidTestCase;
import android.text.TextUtils;
import android.webkit.URLUtil;
import org.junit.Before;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import io.kimo.lib.faker.R;
public class InternetComponentTest extends AndroidTestCase {
private InternetComponent internetComponent;
private NameComponent nameComponent;
private LoremComponent loremComponent;
private List<String> domainSuffixes;
private static final String EMAIL_PATTERN =
"^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
@Before
public void setUp() throws Exception {
internetComponent = new InternetComponent(getContext());
nameComponent = new NameComponent(getContext());
loremComponent = new LoremComponent(getContext());
domainSuffixes = Arrays.asList(getContext().getResources().getStringArray(R.array.domain_suffixes));
}
@Test
public void testEmail() throws Exception {
for(int i = 0; i < 1000; i++) {
String randomEmail = internetComponent.email();
assertTrue(randomEmail.matches(EMAIL_PATTERN));
assertTrue(randomEmail.toLowerCase().equals(randomEmail));
}
}
@Test
public void testEmailWithArguments() throws Exception {
for(int i = 0; i < 1000; i++) {
String randomName = nameComponent.firstName().toLowerCase();
String randomDomain = nameComponent.lastName().toLowerCase();
String randomDomainSuffix = internetComponent.domainSuffix();
String randomEmail = internetComponent.email(randomName, randomDomain, randomDomainSuffix);
assertTrue(randomEmail.contains(randomName));
assertTrue(randomEmail.contains(randomDomain));
assertTrue(randomEmail.contains(randomDomainSuffix));
assertTrue(randomEmail.matches(EMAIL_PATTERN));
}
}
@Test
public void testDomainSuffix() throws Exception {
for(int i = 0; i < 1000; i++) {
assertTrue(domainSuffixes.contains(internetComponent.domainSuffix().replace(".", "")));
}
}
@Test
public void testDomainSuffixWithArguments() throws Exception {
for(int i = 0; i < 1000; i++) {
String randomSuffix = loremComponent.characters(3);
assertTrue(internetComponent.domainSuffix(randomSuffix).contains(randomSuffix));
}
}
@Test
public void testDomain() throws Exception {
for(int i = 0; i < 1000; i++) {
String randomDomain = internetComponent.domain();
assertFalse(TextUtils.isEmpty(randomDomain));
assertTrue(randomDomain.toLowerCase().equals(randomDomain));
}
}
@Test
public void testUrl() throws Exception {
for(int i = 0; i < 1000; i++) {
String randomURL = internetComponent.url();
assertTrue(URLUtil.isValidUrl(randomURL));
assertTrue(randomURL.toLowerCase().equals(randomURL));
}
}
@Test
public void testUrlWithArguments() throws Exception {
for(int i = 0; i < 1000; i++) {
String randomDomain = internetComponent.domain();
String randomSuffix = internetComponent.domainSuffix();
String randomURL = internetComponent.url(randomDomain, randomSuffix);
assertTrue(randomURL.contains(randomDomain));
assertTrue(randomURL.contains(randomSuffix));
}
}
@Test
public void testRandomText() throws Exception {
assertTrue(!TextUtils.isEmpty(internetComponent.randomText()));
}
}
================================================
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/LoremComponentTest.java
================================================
package io.kimo.lib.faker.component.text;
import android.test.AndroidTestCase;
import android.text.TextUtils;
import org.junit.Before;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import io.kimo.lib.faker.R;
import io.kimo.lib.faker.component.text.LoremComponent;
public class LoremComponentTest extends AndroidTestCase {
private LoremComponent loremComponent;
private List<String> loremWords;
private int positiveRandom;
private String alphaNumericRegex = "^[a-zA-Z0-9]*$";
@Before
public void setUp() throws Exception {
loremComponent = new LoremComponent(getContext());
loremWords = Arrays.asList(getContext().getResources().getStringArray(R.array.lorem_words));
positiveRandom = new Random().nextInt(31) + 1;
}
@Test
public void testWord() throws Exception {
assertTrue(loremWords.contains(loremComponent.word()));
}
@Test
public void testWords() throws Exception {
List<String> randomWords = Arrays.asList(loremComponent.words().split(" "));
for(String word : randomWords) {
assertTrue(loremWords.contains(word));
}
}
@Test
public void testWordsWithArguments() throws Exception {
List<String> randomWords = Arrays.asList(loremComponent.words(positiveRandom).split(" "));
assertTrue(randomWords.size() == positiveRandom);
}
@Test
public void testWordsWithInvalidArguments() throws Exception {
try {
loremComponent.words(0);
assertTrue(false);
} catch (IllegalArgumentException e) {
assertTrue(true);
}
}
@Test
public void testSentence() throws Exception {
String randomSentence = loremComponent.sentence();
char firstCharacter = randomSentence.charAt(0);
char lastCharacter = randomSentence.charAt(randomSentence.length()-1);
assertTrue(Character.isUpperCase(firstCharacter));
assertTrue(lastCharacter == '.');
}
@Test
public void testSentences() throws Exception {
String randomSentences = loremComponent.sentences();
assertTrue(randomSentences.split("\\. ").length > 1);
}
@Test
public void testSentencesWithArguments() throws Exception{
List<String> randomSentences = Arrays.asList(loremComponent.sentences(positiveRandom).split("\\."));
assertTrue(randomSentences.size() == positiveRandom);
}
@Test
public void testSentencesWithInvalidArguments() throws Exception{
try {
loremComponent.sentences(0);
assertTrue(false);
} catch (IllegalArgumentException e) {
assertTrue(true);
}
}
@Test
public void testCharacter() throws Exception {
String randomCharacter = loremComponent.character();
assertTrue(randomCharacter.length() == 1);
assertTrue(randomCharacter.matches(alphaNumericRegex));
}
@Test
public void testCharacters() throws Exception {
String randomCharacters = loremComponent.characters();
assertTrue(randomCharacters.length() == 255);
assertTrue(randomCharacters.matches(alphaNumericRegex));
}
@Test
public void testCharactersWithArguments() throws Exception {
String randomCharacters = loremComponent.characters(positiveRandom);
assertTrue(randomCharacters.length() == positiveRandom);
}
@Test
public void testCharactersInvalidArguments() throws Exception {
try {
loremComponent.characters(0);
assertTrue(false);
} catch (IllegalArgumentException e) {
assertTrue(true);
}
}
@Test
public void testParagraph() throws Exception {
String paragraph = loremComponent.paragraph();
String [] numberOfSentences = paragraph.split("\\. ");
assertTrue(numberOfSentences.length >= 3);
}
@Test
public void testParagraphs() throws Exception {
String paragraphs = loremComponent.paragraphs();
assertTrue(paragraphs.contains("\n"));
}
@Test
public void testParagraphsWithArguments() throws Exception {
String paragraphs = loremComponent.paragraphs(positiveRandom);
int numberOfWhiteLines = paragraphs.split("\n").length;
assertTrue(numberOfWhiteLines == positiveRandom);
}
@Test
public void testParagraphsWithInvalidArguments() throws Exception {
try {
loremComponent.paragraphs(0);
assertTrue(false);
} catch (IllegalArgumentException e) {
assertTrue(true);
}
}
@Test
public void testRandomText() throws Exception {
assertTrue(!TextUtils.isEmpty(loremComponent.randomText()));
}
}
================================================
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/NameComponentTest.java
================================================
package io.kimo.lib.faker.component.text;
import android.test.AndroidTestCase;
import android.text.TextUtils;
import org.junit.Before;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import io.kimo.lib.faker.R;
import io.kimo.lib.faker.component.text.NameComponent;
public class NameComponentTest extends AndroidTestCase {
private NameComponent nameComponent;
private List<String> firstNames, lastNames, prefixes, suffixes, titleDescriptions, titleLevels, titleJobs;
@Before
public void setUp() throws Exception {
nameComponent = new NameComponent(getContext());
firstNames = Arrays.asList(getContext().getResources().getStringArray(R.array.first_names));
lastNames = Arrays.asList(getContext().getResources().getStringArray(R.array.last_names));
prefixes = Arrays.asList(getContext().getResources().getStringArray(R.array.prefixes));
suffixes = Arrays.asList(getContext().getResources().getStringArray(R.array.suffixes));
titleDescriptions = Arrays.asList(getContext().getResources().getStringArray(R.array.title_descriptions));
titleLevels = Arrays.asList(getContext().getResources().getStringArray(R.array.title_levels));
titleJobs = Arrays.asList(getContext().getResources().getStringArray(R.array.title_jobs));
}
@Test
public void testFirstName() throws Exception {
for (int i = 0; i < 1000; i++) {
assertTrue(firstNames.contains(nameComponent.firstName()));
}
}
@Test
public void testLastName() throws Exception {
for (int i = 0; i < 1000; i++) {
assertTrue(lastNames.contains(nameComponent.lastName()));
}
}
@Test
public void testFullName() throws Exception {
for(int i = 0; i < 1000; i++) {
String [] fullName = nameComponent.fullName().split(" ");
String firstName = fullName[0];
String lastName = fullName[1];
assertTrue(firstNames.contains(firstName));
assertTrue(lastNames.contains(lastName));
}
}
@Test
public void testCompleteName() throws Exception {
for(int i = 0; i < 1000; i++) {
String [] fullName = nameComponent.completeName().split(" ");
String prefix = fullName[0];
String firstName = fullName[1];
String lastName = fullName[2];
String suffix = fullName[3];
assertTrue(prefixes.contains(prefix));
assertTrue(firstNames.contains(firstName));
assertTrue(lastNames.contains(lastName));
assertTrue(suffixes.contains(suffix));
}
}
@Test
public void testPrefix() throws Exception {
for (int i = 0 ; i < 1000; i++) {
assertTrue(prefixes.contains(nameComponent.prefix()));
}
}
@Test
public void testSuffix() throws Exception {
for (int i = 0 ; i < 1000; i++) {
assertTrue(suffixes.contains(nameComponent.suffix()));
}
}
@Test
public void testTitle() throws Exception {
for (int i = 0 ; i < 1000; i++) {
String [] fullTitle = nameComponent.title().split(" ");
String description = fullTitle[0];
String level = fullTitle[1];
String job = fullTitle[2];
assertTrue(titleDescriptions.contains(description));
assertTrue(titleLevels.contains(level));
assertTrue(titleJobs.contains(job));
}
}
@Test
public void testRandomText() throws Exception {
assertTrue(!TextUtils.isEmpty(nameComponent.randomText()));
}
}
================================================
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/PhoneComponentTest.java
================================================
package io.kimo.lib.faker.component.text;
import android.test.AndroidTestCase;
import android.text.TextUtils;
import org.junit.Before;
import org.junit.Test;
public class PhoneComponentTest extends AndroidTestCase {
private PhoneComponent phoneComponent;
@Before
public void setUp() throws Exception {
phoneComponent = new PhoneComponent(getContext());
}
@Test
public void testPhoneWithAreaCode() throws Exception {
String randomPhoneNumber = phoneComponent.phoneWithAreaCode();
assertTrue(randomPhoneNumber.contains("("));
assertTrue(randomPhoneNumber.contains(")"));
}
@Test
public void testPhoneWithCountryCode() throws Exception {
String randomPhoneNumber = phoneComponent.phoneWithCountryCode();
assertTrue(randomPhoneNumber.contains("-"));
}
@Test
public void testRandomText() throws Exception {
assertTrue(!TextUtils.isEmpty(phoneComponent.randomText()));
}
}
================================================
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/UrlComponentTest.java
================================================
package io.kimo.lib.faker.component.text;
import android.test.AndroidTestCase;
import org.junit.Before;
import org.junit.Test;
import io.kimo.lib.faker.component.number.NumberComponent;
public class UrlComponentTest extends AndroidTestCase {
private URLComponent url;
private NumberComponent numberComponent;
private String imageRegex = "http:\\/\\/lorempixel.com\\/\\d+\\/\\d+";
private String avatarRegex = "https:\\/\\/robohash.org\\/.+";
@Before
public void setUp() throws Exception {
url = new URLComponent(getContext());
numberComponent = new NumberComponent(getContext());
}
@Test
public void testImage() throws Exception {
String randomURL = url.image();
assertTrue(randomURL.matches(imageRegex));
}
@Test
public void testImageWithArguments() throws Exception {
int randomWidth = numberComponent.number(3);
int randomHeight = numberComponent.number(3);
String randomURL = url.image(randomWidth, randomHeight);
assertTrue(randomURL.contains(String.valueOf(randomHeight)));
assertTrue(randomURL.contains(String.valueOf(randomWidth)));
}
@Test
public void testAvatar() throws Exception {
String randomAvatarURL = url.avatar();
assertTrue(randomAvatarURL.matches(avatarRegex));
}
@Test
public void testAvatarWithArguments() throws Exception {
int randomWidth = numberComponent.number(3);
int randomHeight = numberComponent.number(3);
String randomURL = url.avatar(randomWidth, randomHeight);
assertTrue(randomURL.contains(String.valueOf(randomHeight)));
assertTrue(randomURL.contains(String.valueOf(randomWidth)));
}
}
================================================
FILE: faker-core/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.kimo.lib.faker">
<application android:allowBackup="true" android:label="@string/app_name">
</application>
</manifest>
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/Faker.java
================================================
package io.kimo.lib.faker;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.ToggleButton;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Random;
import io.kimo.lib.faker.component.FakerColorComponent;
import io.kimo.lib.faker.component.FakerNumericComponent;
import io.kimo.lib.faker.component.FakerTextComponent;
import io.kimo.lib.faker.component.number.ColorComponent;
import io.kimo.lib.faker.component.number.NumberComponent;
import io.kimo.lib.faker.component.text.AddressComponent;
import io.kimo.lib.faker.component.text.InternetComponent;
import io.kimo.lib.faker.component.text.LoremComponent;
import io.kimo.lib.faker.component.text.NameComponent;
import io.kimo.lib.faker.component.text.PhoneComponent;
import io.kimo.lib.faker.component.text.URLComponent;
public class Faker {
private static Faker mFaker;
public static LoremComponent Lorem;
public static NameComponent Name;
public static NumberComponent Number;
public static PhoneComponent Phone;
public static InternetComponent Internet;
public static URLComponent Url;
public static ColorComponent Color;
public static AddressComponent Address;
private HashSet<Integer> mIds = null;
public static Faker with(Context context) {
if(mFaker == null) {
synchronized (Faker.class) {
if(mFaker == null) {
mFaker = new Faker(context);
}
}
}
return mFaker;
}
/**
* Configure all Faker components with a given context
* @param context
*/
private Faker(Context context) {
Lorem = new LoremComponent(context);
Name = new NameComponent(context);
Number = new NumberComponent(context);
Phone = new PhoneComponent(context);
Internet = new InternetComponent(context);
Url = new URLComponent(context);
Color = new ColorComponent(context);
Address = new AddressComponent(context);
}
/**
* Fill a view with random data
* @param view target view
*/
public void fill(View view) {
validateNotNullableView(view);
try {
if(view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for(int i = 0; i < viewGroup.getChildCount(); i++) {
View child = viewGroup.getChildAt(i);
fill(child);
}
} else {
if(mIds == null) {
fillView(view);
} else if(mIds.contains(view.getId())) {
fillView(view);
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
mFaker = null;
}
}
/**
* Fill a TextView with a specific FakerTextComponent
* @param view
* @param component
*/
public void fillWithText(TextView view, FakerTextComponent component) {
validateNotNullableView(view);
validateIfIsATextView(view);
validateNotNullableFakerComponent(component);
view.setText(component.randomText());
}
/**
* Specify with views are going to be filled with data.
* @param ids - collection of ids
*/
public Faker targetViews(Integer...ids) {
mIds = new HashSet<>(Arrays.asList(ids));
return this;
}
/**
* Fill a TextView with a specific FakerNumericComponent
* @param view
* @param component
*/
public void fillWithNumber(TextView view, FakerNumericComponent component) {
validateNotNullableView(view);
validateIfIsATextView(view);
validateNotNullableFakerComponent(component);
view.setText(String.valueOf(component.randomNumber()));
}
/**
* Fill view with a random color
* @param view
* @param component
*/
public void fillWithColor(View view, FakerColorComponent component) {
validateNotNullableView(view);
validateNotNullableFakerComponent(component);
view.setBackgroundColor(component.randomColor());
}
/**
* Set a random check or uncheck state
* @param view
*/
public void fillWithCheckState(CompoundButton view) {
validateNotNullableView(view);
validateIfIsACompoundButton(view);
view.setChecked(new Random().nextBoolean());
}
/**
* Fill {@link ToggleButton} on and off text
* @param view
* @param component
*/
public void fillOnAndOffWithText(ToggleButton view, FakerTextComponent component) {
validateNotNullableView(view);
validateIfIsAToggleButton(view);
validateNotNullableFakerComponent(component);
String word = component.randomText();
view.setTextOff(word);
view.setTextOn(word);
}
/**
* Fill a @{link ProgressBar} with a random progress
* @param view
* @param component
*/
public void fillWithProgress(ProgressBar view, FakerNumericComponent component) {
validateNotNullableView(view);
validateIfIsAProgressBar(view);
validateNotNullableFakerComponent(component);
view.setProgress(Math.abs(component.randomNumber().intValue()));
}
private void fillView(View view) {
if(view instanceof TextView) {
if(view instanceof ToggleButton) {
fillOnAndOffWithText((ToggleButton) view, Lorem);
} else {
fillWithText((TextView) view, Lorem);
}
}
if(view instanceof CompoundButton) {
fillWithCheckState((CompoundButton) view);
}
if(view instanceof ImageView) {
fillWithColor(view, Color);
}
if(view instanceof ProgressBar) {
fillWithProgress((ProgressBar) view, Number);
}
}
private void validateIfIsACompoundButton(View view) {
if(!(view instanceof CompoundButton))
throw new IllegalArgumentException("View must be a CompoundButton");
}
private void validateIfIsATextView(View view) {
if(!(view instanceof TextView))
throw new IllegalArgumentException("View must be a TextView");
}
private void validateNotNullableView(View view) {
if(view == null) {
throw new IllegalArgumentException("View must not be null");
}
}
private void validateNotNullableFakerComponent(FakerCoreComponent component) {
if(component == null) {
throw new IllegalArgumentException("FakerComponent must not be null");
}
}
private void validateIfIsAToggleButton(View view) {
if(!(view instanceof ToggleButton)) {
throw new IllegalArgumentException("View must be a ToggleButton");
}
}
private void validateIfIsAProgressBar(View view) {
if(!(view instanceof ProgressBar)) {
throw new IllegalArgumentException("View must be a ProgressBar");
}
}
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/FakerCoreComponent.java
================================================
package io.kimo.lib.faker;
import android.content.Context;
public abstract class FakerCoreComponent {
protected Context context;
public FakerCoreComponent(Context context) {
if(context == null) {
throw new IllegalArgumentException("Context must not be null.");
}
this.context = context;
}
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/AddressAPI.java
================================================
package io.kimo.lib.faker.api;
public interface AddressAPI {
String city();
String street();
String streetWithNumber();
String secondaryAddress();
String buildingNumber();
String zipCode();
String postCode();
String timeZone();
String citySuffix();
String cityPrefix();
String state();
String stateAbbreviation();
String country();
String countryAbbreviation();
String latitude();
String longitude();
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/ColorAPI.java
================================================
package io.kimo.lib.faker.api;
public interface ColorAPI {
int redColor();
int [] redColors(int numberOfRedColors);
int greenColor();
int [] greenColors(int numberOfGreenColors);
int blueColor();
int [] blueColors(int numberOfBlueColors);
int monochromeColor();
int brightColor();
int lightColor();
int darkColor();
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/InternetAPI.java
================================================
package io.kimo.lib.faker.api;
public interface InternetAPI {
String email();
String email(String name, String domain, String suffix);
String domain();
String domainSuffix();
String domainSuffix(String suffix);
String url();
String url(String domain, String suffix);
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/LoremAPI.java
================================================
package io.kimo.lib.faker.api;
public interface LoremAPI {
String character();
String characters();
String characters(int numberOfCharacters);
String word();
String words();
String words(int numberOfWords);
String sentence();
String sentences();
String sentences(int numberOfSentences);
String paragraph();
String paragraphs();
String paragraphs(int numberOfParagraphs);
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/NameAPI.java
================================================
package io.kimo.lib.faker.api;
public interface NameAPI {
String firstName();
String lastName();
String fullName();
String completeName();
String prefix();
String suffix();
String title();
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/NumberAPI.java
================================================
package io.kimo.lib.faker.api;
import java.util.Random;
public interface NumberAPI {
void setSeed(Random random);
int digit();
int positiveDigit();
int negativeDigit();
int number();
int number(int amountOfDigits);
int positiveNumber();
int negativeNumber();
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/PhoneAPI.java
================================================
package io.kimo.lib.faker.api;
public interface PhoneAPI {
String phoneWithAreaCode();
String phoneWithCountryCode();
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/UrlAPI.java
================================================
package io.kimo.lib.faker.api;
public interface UrlAPI {
String image();
String image(int width, int height);
String avatar();
String avatar(int width, int height);
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/FakerColorComponent.java
================================================
package io.kimo.lib.faker.component;
import android.content.Context;
public abstract class FakerColorComponent extends FakerNumericComponent {
public FakerColorComponent(Context context) {
super(context);
}
public abstract int randomColor();
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/FakerNumericComponent.java
================================================
package io.kimo.lib.faker.component;
import android.content.Context;
import io.kimo.lib.faker.FakerCoreComponent;
public abstract class FakerNumericComponent extends FakerCoreComponent {
public FakerNumericComponent(Context context) {
super(context);
}
public abstract Number randomNumber();
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/FakerTextComponent.java
================================================
package io.kimo.lib.faker.component;
import android.content.Context;
import io.kimo.lib.faker.FakerCoreComponent;
public abstract class FakerTextComponent extends FakerCoreComponent {
public FakerTextComponent(Context context) {
super(context);
}
public abstract String randomText();
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/number/ColorComponent.java
================================================
package io.kimo.lib.faker.component.number;
import android.content.Context;
import com.github.lzyzsd.randomcolor.RandomColor;
import io.kimo.lib.faker.api.ColorAPI;
import io.kimo.lib.faker.component.FakerColorComponent;
/**
* Provides random colors based on AndroidRandomColor by lzyzsd (https://github.com/lzyzsd/AndroidRandomColor)
*/
public class ColorComponent extends FakerColorComponent implements ColorAPI {
public ColorComponent(Context context) {
super(context);
}
@Override
public Number randomNumber() {
return randomColor();
}
@Override
public int randomColor() {
return new RandomColor().randomColor();
}
@Override
public int redColor() {
return new RandomColor().randomColor(RandomColor.Color.RED);
}
@Override
public int[] redColors(int numberOfRedColors) {
return new RandomColor().random(RandomColor.Color.RED, numberOfRedColors);
}
@Override
public int greenColor() {
return new RandomColor().randomColor(RandomColor.Color.GREEN);
}
@Override
public int[] greenColors(int numberOfGreenColors) {
return new RandomColor().random(RandomColor.Color.GREEN, numberOfGreenColors);
}
@Override
public int blueColor() {
return new RandomColor().randomColor(RandomColor.Color.BLUE);
}
@Override
public int[] blueColors(int numberOfBlueColors) {
return new RandomColor().random(RandomColor.Color.BLUE, numberOfBlueColors);
}
@Override
public int monochromeColor() {
return new RandomColor().randomColor(randomColor(), RandomColor.SaturationType.MONOCHROME, RandomColor.Luminosity.RANDOM);
}
@Override
public int brightColor() {
return new RandomColor().randomColor(randomColor(), RandomColor.SaturationType.RANDOM, RandomColor.Luminosity.BRIGHT);
}
@Override
public int lightColor() {
return new RandomColor().randomColor(randomColor(), RandomColor.SaturationType.RANDOM, RandomColor.Luminosity.LIGHT);
}
@Override
public int darkColor() {
return new RandomColor().randomColor(randomColor(), RandomColor.SaturationType.RANDOM, RandomColor.Luminosity.DARK);
}
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/number/NumberComponent.java
================================================
package io.kimo.lib.faker.component.number;
import android.content.Context;
import java.util.Random;
import io.kimo.lib.faker.api.NumberAPI;
import io.kimo.lib.faker.component.FakerNumericComponent;
public class NumberComponent extends FakerNumericComponent implements NumberAPI {
private Random mRandom = new Random();
public NumberComponent(Context context) {
super(context);
}
@Override
public Number randomNumber() {
int method = (int)(Math.random() * 10);
switch (method % 6) {
case 0:
return digit();
case 1:
return positiveDigit();
case 2:
return negativeDigit();
case 3:
return number();
case 4:
return positiveNumber();
case 5:
return negativeNumber();
default:
return 0;
}
}
private int randomNumberInRangePositiveOrNegative(int min, int max) {
return mRandom.nextInt((max - min) + 1) + min;
}
@Override
public void setSeed(Random random) {
mRandom = random;
}
public Random getSeed() {
return mRandom;
}
@Override
public int digit() {
return randomNumberInRangePositiveOrNegative(-9, 9);
}
@Override
public int positiveDigit() {
return randomNumberInRangePositiveOrNegative(0, 9);
}
@Override
public int negativeDigit() {
return randomNumberInRangePositiveOrNegative(-9,-1);
}
@Override
public int number() {
int randomSignal = (int) (Math.random() * 10);
if(randomSignal % 2 == 0) {
return number(randomNumberInRangePositiveOrNegative(1, 9));
} else {
return -number(randomNumberInRangePositiveOrNegative(1, 9));
}
}
@Override
public int number(int amountOfDigits) {
if(amountOfDigits < 1) {
throw new IllegalArgumentException("Argument must be bigger than 0");
}
StringBuilder randomNumbers = new StringBuilder();
for(int i = 0; i < amountOfDigits; i++) {
randomNumbers.append(randomNumberInRangePositiveOrNegative(1,9));
}
return Math.abs(Integer.parseInt(randomNumbers.toString()));
}
@Override
public int positiveNumber() {
return Math.abs(number());
}
@Override
public int negativeNumber() {
return -positiveNumber();
}
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/AddressComponent.java
================================================
package io.kimo.lib.faker.component.text;
import android.content.Context;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import io.kimo.lib.faker.R;
import io.kimo.lib.faker.api.AddressAPI;
import io.kimo.lib.faker.component.FakerTextComponent;
import io.kimo.lib.faker.component.number.NumberComponent;
public class AddressComponent extends FakerTextComponent implements AddressAPI {
private NameComponent nameComponent;
private NumberComponent numberComponent;
private List<String> cityPrefixes, citySuffixes, streetSuffixes, secondaryAddressPrefixes, zipCodeMasks, timezones, states, statesAbbrv, countries, countriesAbbrv;
public AddressComponent(Context context) {
super(context);
nameComponent = new NameComponent(context);
numberComponent = new NumberComponent(context);
cityPrefixes = Arrays.asList(context.getResources().getStringArray(R.array.city_prefixes));
citySuffixes = Arrays.asList(context.getResources().getStringArray(R.array.city_suffixes));
streetSuffixes = Arrays.asList(context.getResources().getStringArray(R.array.street_suffixes));
secondaryAddressPrefixes = Arrays.asList(context.getResources().getStringArray(R.array.secondary_address_prefixes));
zipCodeMasks = Arrays.asList(context.getResources().getStringArray(R.array.zipcode_masks));
timezones = Arrays.asList(context.getResources().getStringArray(R.array.timezone));
states = Arrays.asList(context.getResources().getStringArray(R.array.states));
statesAbbrv = Arrays.asList(context.getResources().getStringArray(R.array.states_abbrv));
countries = Arrays.asList(context.getResources().getStringArray(R.array.countries));
countriesAbbrv = Arrays.asList(context.getResources().getStringArray(R.array.countries_abbrv));
}
private String numbersInMask(String mask, char maskPlaceholder) {
StringBuilder phoneInMask = new StringBuilder();
for(int i = 0; i < mask.length(); i++) {
char currentChar = mask.charAt(i);
if(currentChar == maskPlaceholder) {
phoneInMask.append(numberComponent.positiveDigit());
} else {
phoneInMask.append(currentChar);
}
}
return phoneInMask.toString();
}
@Override
public String city() {
Random random = new Random();
StringBuilder cityName = new StringBuilder();
boolean withFirstName = random.nextBoolean();
boolean withPrefix = random.nextBoolean();
boolean withSuffix;
if(withPrefix) {
withSuffix = random.nextBoolean();
} else {
withSuffix = true;
}
if(withPrefix) {
cityName.append(cityPrefix());
}
cityName.append(" ");
if(withFirstName) {
cityName.append(nameComponent.firstName());
} else {
cityName.append(nameComponent.lastName());
}
if(withSuffix) {
cityName.append(" ");
cityName.append(citySuffix());
}
return cityName.toString();
}
@Override
public String street() {
boolean firstName = new Random().nextBoolean();
if(firstName) {
return nameComponent.firstName() + " " + streetSuffixes.get(new Random().nextInt(streetSuffixes.size()));
} else {
return nameComponent.lastName() + " " + streetSuffixes.get(new Random().nextInt(streetSuffixes.size()));
}
}
@Override
public String streetWithNumber() {
return buildingNumber() + " " + street();
}
@Override
public String secondaryAddress() {
return secondaryAddressPrefixes.get(new Random().nextInt(secondaryAddressPrefixes.size())) + " " + buildingNumber();
}
@Override
public String buildingNumber() {
return numberComponent.positiveNumber()+"";
}
@Override
public String zipCode() {
String mask = zipCodeMasks.get(new Random().nextInt(zipCodeMasks.size()));
return numbersInMask(mask, '#');
}
@Override
public String postCode() {
return zipCode();
}
@Override
public String timeZone() {
return timezones.get(new Random().nextInt(timezones.size()));
}
@Override
public String citySuffix() {
return citySuffixes.get(new Random().nextInt(citySuffixes.size()));
}
@Override
public String cityPrefix() {
return cityPrefixes.get(new Random().nextInt(cityPrefixes.size()));
}
@Override
public String state() {
return states.get(new Random().nextInt(states.size()));
}
@Override
public String stateAbbreviation() {
return statesAbbrv.get(new Random().nextInt(statesAbbrv.size()));
}
@Override
public String country() {
return countries.get(new Random().nextInt(countries.size()));
}
@Override
public String countryAbbreviation() {
return countriesAbbrv.get(new Random().nextInt(countriesAbbrv.size()));
}
@Override
public String latitude() {
return String.valueOf((Math.random() * 180) - 90);
}
@Override
public String longitude() {
return String.valueOf((Math.random() * 360) - 90);
}
@Override
public String randomText() {
int method = (int) Math.random() * 10;
switch (method % 15) {
case 0:
return city();
case 1:
return street();
case 2:
return streetWithNumber();
case 3:
return secondaryAddress();
case 4:
return buildingNumber();
case 5:
return zipCode();
case 6:
return postCode();
case 7:
return citySuffix();
case 8:
return cityPrefix();
case 9:
return state();
case 10:
return stateAbbreviation();
case 11:
return country();
case 12:
return countryAbbreviation();
case 13:
return latitude();
case 14:
return longitude();
default:
return "";
}
}
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/InternetComponent.java
================================================
package io.kimo.lib.faker.component.text;
import android.content.Context;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import io.kimo.lib.faker.R;
import io.kimo.lib.faker.api.InternetAPI;
import io.kimo.lib.faker.component.FakerTextComponent;
public class InternetComponent extends FakerTextComponent implements InternetAPI {
private NameComponent nameComponent;
private List<String> domainSuffix;
public InternetComponent(Context context) {
super(context);
nameComponent = new NameComponent(context);
domainSuffix = Arrays.asList(context.getResources().getStringArray(R.array.domain_suffixes));
}
@Override
public String randomText() {
int method = (int)(Math.random() * 10);
switch (method % 4) {
case 0:
return email();
case 1:
return domain();
case 2:
return domainSuffix();
case 3:
return url();
default:
return "";
}
}
@Override
public String email() {
return email(nameComponent.firstName(), domain(), domainSuffix());
}
@Override
public String email(String name, String domain, String suffix) {
return (name + "@" + domain + suffix).toLowerCase();
}
@Override
public String domain() {
return nameComponent.lastName().toLowerCase();
}
@Override
public String domainSuffix() {
return domainSuffix(domainSuffix.get(new Random().nextInt(domainSuffix.size())));
}
@Override
public String domainSuffix(String suffix) {
return "."+suffix;
}
@Override
public String url() {
return url(nameComponent.lastName(), domainSuffix());
}
@Override
public String url(String domain, String suffix) {
return ("http://" + domain + suffix).toLowerCase();
}
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/LoremComponent.java
================================================
package io.kimo.lib.faker.component.text;
import android.content.Context;
import android.text.TextUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import io.kimo.lib.faker.R;
import io.kimo.lib.faker.api.LoremAPI;
import io.kimo.lib.faker.component.FakerTextComponent;
public class LoremComponent extends FakerTextComponent implements LoremAPI {
public static final int [] DEFAULT_RANDOM_NUMBERS_POOL = {3,4,5,6,7};
public static final int DEFAULT_NUMBER_OF_CHARACTERS = 255;
public static final String ALPHA_NUMERIC_CHARACTERS = "0123456789abcdefghijklmnopqrstuwvxyz";
public static final String INVALID_ARGUMENT_ERROR_MSG = "Argument should be bigger than 0";
private List<String> loremWords;
public LoremComponent(Context context) {
super(context);
loremWords = Arrays.asList(context.getResources().getStringArray(R.array.lorem_words));
}
@Override
public String randomText() {
int method = (int)(Math.random() * 10);
switch (method % 4) {
case 0:
return characters();
case 1:
return words();
case 2:
return sentences();
case 3:
return paragraphs();
default:
return "";
}
}
/**
* Provides a random words from the words list
* @return a String with the word
*/
@Override
public String word() {
return loremWords.get(new Random().nextInt(loremWords.size()));
}
/**
* Provies random words from the words list.
* The amount of words varies from 3 to 7.
* @return a String with the words
*/
@Override
public String words() {
int numberOfWords = DEFAULT_RANDOM_NUMBERS_POOL[new Random().nextInt(DEFAULT_RANDOM_NUMBERS_POOL.length)];
return words(numberOfWords);
}
/**
* Provides the
* @param numberOfWords
* @return a String with the words
*/
@Override
public String words(int numberOfWords) {
if (numberOfWords < 1) {
throw new IllegalArgumentException(INVALID_ARGUMENT_ERROR_MSG);
}
List<String> loremWords = new ArrayList<>();
for(int i = 0; i < numberOfWords; i++) {
loremWords.add(word());
}
return TextUtils.join(" ", loremWords);
}
@Override
public String sentence() {
String randomWords = words();
return randomWords.substring(0,1).toUpperCase() + randomWords.substring(1) + ".";
}
@Override
public String sentences() {
int randomNumberOfSentences = DEFAULT_RANDOM_NUMBERS_POOL[new Random().nextInt(DEFAULT_RANDOM_NUMBERS_POOL.length)];
return sentences(randomNumberOfSentences);
}
@Override
public String sentences(int numberOfSentences) {
if (numberOfSentences < 1) {
throw new IllegalArgumentException(INVALID_ARGUMENT_ERROR_MSG);
}
List<String> sentences = new ArrayList<>();
for(int i = 0; i < numberOfSentences; i++) {
sentences.add(sentence());
}
return TextUtils.join(" ", sentences);
}
@Override
public String character() {
return characters(1);
}
@Override
public String characters() {
return characters(DEFAULT_NUMBER_OF_CHARACTERS);
}
@Override
public String characters(int numberOfCharacters) {
if(numberOfCharacters < 1) {
throw new IllegalArgumentException(INVALID_ARGUMENT_ERROR_MSG);
}
StringBuilder randomCharacters = new StringBuilder();
for(int i = 0; i < numberOfCharacters; i++) {
randomCharacters.append(ALPHA_NUMERIC_CHARACTERS.charAt(new Random().nextInt(ALPHA_NUMERIC_CHARACTERS.length())));
}
return randomCharacters.toString();
}
@Override
public String paragraph() {
return paragraphs(1);
}
@Override
public String paragraphs() {
int randomNumberOfParagraphs = DEFAULT_RANDOM_NUMBERS_POOL[new Random().nextInt(DEFAULT_RANDOM_NUMBERS_POOL.length)];
return paragraphs(randomNumberOfParagraphs);
}
@Override
public String paragraphs(int numberOfParagraphs) {
if(numberOfParagraphs < 1) {
throw new IllegalArgumentException(INVALID_ARGUMENT_ERROR_MSG);
}
StringBuilder paragraphs = new StringBuilder();
for(int i = 0; i < numberOfParagraphs; i++) {
paragraphs.append(sentences());
if(i != numberOfParagraphs-1) {
paragraphs.append("\n");
}
}
return paragraphs.toString();
}
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/NameComponent.java
================================================
package io.kimo.lib.faker.component.text;
import android.content.Context;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import io.kimo.lib.faker.R;
import io.kimo.lib.faker.api.NameAPI;
import io.kimo.lib.faker.component.FakerTextComponent;
public class NameComponent extends FakerTextComponent implements NameAPI {
private List<String> firstNames, lastNames, prefixes, suffixes, titleDescriptons, titleLevels, titleJobs;
public NameComponent(Context context) {
super(context);
firstNames = Arrays.asList(context.getResources().getStringArray(R.array.first_names));
lastNames = Arrays.asList(context.getResources().getStringArray(R.array.last_names));
prefixes = Arrays.asList(context.getResources().getStringArray(R.array.prefixes));
suffixes = Arrays.asList(context.getResources().getStringArray(R.array.suffixes));
titleDescriptons = Arrays.asList(context.getResources().getStringArray(R.array.title_descriptions));
titleLevels = Arrays.asList(context.getResources().getStringArray(R.array.title_levels));
titleJobs = Arrays.asList(context.getResources().getStringArray(R.array.title_jobs));
}
@Override
public String randomText() {
int method = (int)(Math.random() * 10);
switch (method % 7) {
case 0:
return firstName();
case 1:
return lastName();
case 2:
return fullName();
case 3:
return completeName();
case 4:
return prefix();
case 5:
return suffix();
case 6:
return title();
default:
return "";
}
}
@Override
public String firstName() {
return firstNames.get(new Random().nextInt(firstNames.size()));
}
@Override
public String lastName() {
return lastNames.get(new Random().nextInt(lastNames.size()));
}
@Override
public String fullName() {
return firstName() + " " + lastName();
}
@Override
public String completeName() {
return prefix() + " " + firstName() + " " + lastName() + " " + suffix();
}
@Override
public String prefix() {
return prefixes.get(new Random().nextInt(prefixes.size()));
}
@Override
public String suffix() {
return suffixes.get(new Random().nextInt(suffixes.size()));
}
@Override
public String title() {
return titleDescriptons.get(new Random().nextInt(titleDescriptons.size())) +
" " +
titleLevels.get(new Random().nextInt(titleLevels.size())) +
" " +
titleJobs.get(new Random().nextInt(titleJobs.size()));
}
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/PhoneComponent.java
================================================
package io.kimo.lib.faker.component.text;
import android.content.Context;
import java.lang.*;
import io.kimo.lib.faker.R;
import io.kimo.lib.faker.api.PhoneAPI;
import io.kimo.lib.faker.component.FakerTextComponent;
import io.kimo.lib.faker.component.number.NumberComponent;
public class PhoneComponent extends FakerTextComponent implements PhoneAPI {
private String areaCodeMask, countryCodeMask;
private NumberComponent numberComponent;
public PhoneComponent(Context context) {
super(context);
numberComponent = new NumberComponent(context);
areaCodeMask = context.getResources().getString(R.string.area_code_phone_mask);
countryCodeMask = context.getResources().getString(R.string.country_code_phone_mask);
}
@Override
public String randomText() {
int method = (int)(Math.random() * 10);
switch (method % 2) {
case 0:
return phoneWithAreaCode();
case 1:
return phoneWithCountryCode();
default:
return "";
}
}
private String numbersInMask(String mask, char maskPlaceholder) {
StringBuilder phoneInMask = new StringBuilder();
for(int i = 0; i < mask.length(); i++) {
char currentChar = mask.charAt(i);
if(currentChar == maskPlaceholder) {
phoneInMask.append(numberComponent.positiveDigit());
} else {
phoneInMask.append(currentChar);
}
}
return phoneInMask.toString();
}
@Override
public String phoneWithAreaCode() {
return numbersInMask(areaCodeMask, '#');
}
@Override
public String phoneWithCountryCode() {
return numbersInMask(countryCodeMask, '#');
}
}
================================================
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/URLComponent.java
================================================
package io.kimo.lib.faker.component.text;
import android.content.Context;
import io.kimo.lib.faker.api.UrlAPI;
import io.kimo.lib.faker.component.FakerTextComponent;
public class URLComponent extends FakerTextComponent implements UrlAPI {
private static final String BASE_IMAGE_URL = "http://lorempixel.com/";
private static final String BASE_AVATAR_URL = "https://robohash.org/";
private static final int DEFAULT_DIMENSION = 300;
private NameComponent nameComponent;
public URLComponent(Context context) {
super(context);
nameComponent = new NameComponent(context);
}
@Override
public String randomText() {
int method = (int)(Math.random() * 10);
switch (method % 2) {
case 0:
return image();
case 1:
return avatar();
default:
return "";
}
}
@Override
public String image() {
return image(DEFAULT_DIMENSION,DEFAULT_DIMENSION);
}
@Override
public String image(int width, int height) {
return BASE_IMAGE_URL + width + "/" + height;
}
@Override
public String avatar() {
return avatar(DEFAULT_DIMENSION,DEFAULT_DIMENSION);
}
@Override
public String avatar(int width, int height) {
return BASE_AVATAR_URL + nameComponent.firstName() + "?size=" + width + "x" + height;
}
}
================================================
FILE: faker-core/src/main/res/values/address.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="city_prefixes">
<item>North</item>
<item>East</item>
<item>West</item>
<item>South</item>
<item>New</item>
<item>Lake</item>
<item>Port</item>
</string-array>
<string-array name="city_suffixes">
<item>town</item>
<item>ton</item>
<item>land</item>
<item>ville</item>
<item>berg</item>
<item>burgh</item>
<item>borough</item>
<item>bury</item>
<item>view</item>
<item>port</item>
<item>mouth</item>
<item>stad</item>
<item>furt</item>
<item>chester</item>
<item>fort</item>
<item>haven</item>
<item>side</item>
<item>shire</item>
</string-array>
<string-array name="street_suffixes">
<item>Alley</item>
<item>Avenue</item>
<item>Branch</item>
<item>Bridge</item>
<item>Brook</item>
<item>Brooks</item>
<item>Burg</item>
<item>Burgs</item>
<item>Bypass</item>
<item>Camp</item>
<item>Canyon</item>
<item>Cape</item>
<item>Causeway</item>
<item>Center</item>
<item>Centers</item>
<item>Circle</item>
<item>Circles</item>
<item>Cliff</item>
<item>Cliffs</item>
<item>Club</item>
<item>Common</item>
<item>Corner</item>
<item>Corners</item>
<item>Course</item>
<item>Court</item>
<item>Courts</item>
<item>Cove</item>
<item>Coves</item>
<item>Creek</item>
<item>Crescent</item>
<item>Crest</item>
<item>Crossing</item>
<item>Crossroad</item>
<item>Curve</item>
<item>Dale</item>
<item>Dam</item>
<item>Divide</item>
<item>Drive</item>
<item>Drive</item>
<item>Drives</item>
<item>Estate</item>
<item>Estates</item>
<item>Expressway</item>
<item>Extension</item>
<item>Extensions</item>
<item>Fall</item>
<item>Falls</item>
<item>Ferry</item>
<item>Field</item>
<item>Fields</item>
<item>Flat</item>
<item>Flats</item>
<item>Ford</item>
<item>Fords</item>
<item>Forest</item>
<item>Forge</item>
<item>Forges</item>
<item>Fork</item>
<item>Forks</item>
<item>Fort</item>
<item>Freeway</item>
<item>Garden</item>
<item>Gardens</item>
<item>Gateway</item>
<item>Glen</item>
<item>Glens</item>
<item>Green</item>
<item>Greens</item>
<item>Grove</item>
<item>Groves</item>
<item>Harbor</item>
<item>Harbors</item>
<item>Haven</item>
<item>Heights</item>
<item>Highway</item>
<item>Hill</item>
<item>Hills</item>
<item>Hollow</item>
<item>Inlet</item>
<item>Inlet</item>
<item>Island</item>
<item>Island</item>
<item>Islands</item>
<item>Islands</item>
<item>Isle</item>
<item>Isle</item>
<item>Junction</item>
<item>Junctions</item>
<item>Key</item>
<item>Keys</item>
<item>Knoll</item>
<item>Knolls</item>
<item>Lake</item>
<item>Lakes</item>
<item>Land</item>
<item>Landing</item>
<item>Lane</item>
<item>Light</item>
<item>Lights</item>
<item>Loaf</item>
<item>Lock</item>
<item>Locks</item>
<item>Locks</item>
<item>Lodge</item>
<item>Lodge</item>
<item>Loop</item>
<item>Mall</item>
<item>Manor</item>
<item>Manors</item>
<item>Meadow</item>
<item>Meadows</item>
<item>Mews</item>
<item>Mill</item>
<item>Mills</item>
<item>Mission</item>
<item>Mission</item>
<item>Motorway</item>
<item>Mount</item>
<item>Mountain</item>
<item>Mountain</item>
<item>Mountains</item>
<item>Mountains</item>
<item>Neck</item>
<item>Orchard</item>
<item>Oval</item>
<item>Overpass</item>
<item>Park</item>
<item>Parks</item>
<item>Parkway</item>
<item>Parkways</item>
<item>Pass</item>
<item>Passage</item>
<item>Path</item>
<item>Pike</item>
<item>Pine</item>
<item>Pines</item>
<item>Place</item>
<item>Plain</item>
<item>Plains</item>
<item>Plains</item>
<item>Plaza</item>
<item>Plaza</item>
<item>Point</item>
<item>Points</item>
<item>Port</item>
<item>Port</item>
<item>Ports</item>
<item>Ports</item>
<item>Prairie</item>
<item>Prairie</item>
<item>Radial</item>
<item>Ramp</item>
<item>Ranch</item>
<item>Rapid</item>
<item>Rapids</item>
<item>Rest</item>
<item>Ridge</item>
<item>Ridges</item>
<item>River</item>
<item>Road</item>
<item>Road</item>
<item>Roads</item>
<item>Roads</item>
<item>Route</item>
<item>Row</item>
<item>Rue</item>
<item>Run</item>
<item>Shoal</item>
<item>Shoals</item>
<item>Shore</item>
<item>Shores</item>
<item>Skyway</item>
<item>Spring</item>
<item>Springs</item>
<item>Springs</item>
<item>Spur</item>
<item>Spurs</item>
<item>Square</item>
<item>Square</item>
<item>Squares</item>
<item>Squares</item>
<item>Station</item>
<item>Station</item>
<item>Stravenue</item>
<item>Stravenue</item>
<item>Stream</item>
<item>Stream</item>
<item>Street</item>
<item>Street</item>
<item>Streets</item>
<item>Summit</item>
<item>Summit</item>
<item>Terrace</item>
<item>Throughway</item>
<item>Trace</item>
<item>Track</item>
<item>Trafficway</item>
<item>Trail</item>
<item>Trail</item>
<item>Tunnel</item>
<item>Tunnel</item>
<item>Turnpike</item>
<item>Turnpike</item>
<item>Underpass</item>
<item>Union</item>
<item>Unions</item>
<item>Valley</item>
<item>Valleys</item>
<item>Via</item>
<item>Viaduct</item>
<item>View</item>
<item>Views</item>
<item>Village</item>
<item>Village</item>
<item>Villages</item>
<item>Ville</item>
<item>Vista</item>
<item>Vista</item>
<item>Walk</item>
<item>Walks</item>
<item>Wall</item>
<item>Way</item>
<item>Ways</item>
<item>Well</item>
<item>Well</item>
</string-array>
<string-array name="secondary_address_prefixes">
<item>Apt.</item>
<item>Suite</item>
<item>Block</item>
</string-array>
<string-array name="zipcode_masks">
<item>#####</item>
<item>#####-####</item>
</string-array>
<string-array name="timezone">
<item>Pacific/Midway</item>
<item>Pacific/Pago_Pago</item>
<item>Pacific/Honolulu</item>
<item>America/Juneau</item>
<item>America/Los_Angeles</item>
<item>America/Tijuana</item>
<item>America/Denver</item>
<item>America/Phoenix</item>
<item>America/Chihuahua</item>
<item>America/Mazatlan</item>
<item>America/Chicago</item>
<item>America/Regina</item>
<item>America/Mexico_City</item>
<item>America/Mexico_City</item>
<item>America/Monterrey</item>
<item>America/Guatemala</item>
<item>America/New_York</item>
<item>America/Indiana/Indianapolis</item>
<item>America/Bogota</item>
<item>America/Lima</item>
<item>America/Lima</item>
<item>America/Halifax</item>
<item>America/Caracas</item>
<item>America/La_Paz</item>
<item>America/Santiago</item>
<item>America/St_Johns</item>
<item>America/Sao_Paulo</item>
<item>America/Argentina/Buenos_Aires</item>
<item>America/Guyana</item>
<item>America/Godthab</item>
<item>Atlantic/South_Georgia</item>
<item>Atlantic/Azores</item>
<item>Atlantic/Cape_Verde</item>
<item>Europe/Dublin</item>
<item>Europe/London</item>
<item>Europe/Lisbon</item>
<item>Europe/London</item>
<item>Africa/Casablanca</item>
<item>Africa/Monrovia</item>
<item>Etc/UTC</item>
<item>Europe/Belgrade</i
gitextract_z0fqpsma/ ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── app/ │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src/ │ └── main/ │ ├── AndroidManifest.xml │ ├── java/ │ │ └── io/ │ │ └── kimo/ │ │ └── faker/ │ │ ├── FakerApp.java │ │ ├── mvp/ │ │ │ ├── BasePresenter.java │ │ │ ├── BaseView.java │ │ │ ├── Presenter.java │ │ │ ├── View.java │ │ │ ├── presenter/ │ │ │ │ ├── AddressPresenter.java │ │ │ │ ├── ColorPresenter.java │ │ │ │ ├── InternetPresenter.java │ │ │ │ ├── LoremPresenter.java │ │ │ │ ├── NamePresenter.java │ │ │ │ ├── NumberPresenter.java │ │ │ │ ├── PhonePresenter.java │ │ │ │ └── UrlPresenter.java │ │ │ └── view/ │ │ │ ├── AddressView.java │ │ │ ├── ColorView.java │ │ │ ├── InternetView.java │ │ │ ├── LoremView.java │ │ │ ├── NameView.java │ │ │ ├── NumberView.java │ │ │ ├── PhoneView.java │ │ │ └── UrlView.java │ │ └── ui/ │ │ ├── activity/ │ │ │ └── MainActivity.java │ │ └── fragment/ │ │ ├── AddressFragment.java │ │ ├── ColorFragment.java │ │ ├── InternetFragment.java │ │ ├── LoremFragment.java │ │ ├── NameFragment.java │ │ ├── NumberFragment.java │ │ ├── PhoneFragment.java │ │ ├── ProfileFragment.java │ │ ├── TargetViewsFragment.java │ │ ├── UrlFragment.java │ │ └── WidgetsFragment.java │ └── res/ │ ├── layout/ │ │ ├── activity_with_toolbar.xml │ │ ├── fragment_address.xml │ │ ├── fragment_color.xml │ │ ├── fragment_internet.xml │ │ ├── fragment_lorem.xml │ │ ├── fragment_name.xml │ │ ├── fragment_number.xml │ │ ├── fragment_phone.xml │ │ ├── fragment_profile.xml │ │ ├── fragment_target_views.xml │ │ ├── fragment_url.xml │ │ ├── fragment_widgets.xml │ │ ├── header_drawer.xml │ │ └── view_loading.xml │ ├── menu/ │ │ └── menu_main.xml │ ├── values/ │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ ├── values-v21/ │ │ └── styles.xml │ └── values-w820dp/ │ └── dimens.xml ├── build.gradle ├── faker-core/ │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── io/ │ │ └── kimo/ │ │ └── lib/ │ │ └── faker/ │ │ └── component/ │ │ ├── number/ │ │ │ └── NumberComponentTest.java │ │ └── text/ │ │ ├── AddressComponentTest.java │ │ ├── InternetComponentTest.java │ │ ├── LoremComponentTest.java │ │ ├── NameComponentTest.java │ │ ├── PhoneComponentTest.java │ │ └── UrlComponentTest.java │ └── main/ │ ├── AndroidManifest.xml │ ├── java/ │ │ └── io/ │ │ └── kimo/ │ │ └── lib/ │ │ └── faker/ │ │ ├── Faker.java │ │ ├── FakerCoreComponent.java │ │ ├── api/ │ │ │ ├── AddressAPI.java │ │ │ ├── ColorAPI.java │ │ │ ├── InternetAPI.java │ │ │ ├── LoremAPI.java │ │ │ ├── NameAPI.java │ │ │ ├── NumberAPI.java │ │ │ ├── PhoneAPI.java │ │ │ └── UrlAPI.java │ │ └── component/ │ │ ├── FakerColorComponent.java │ │ ├── FakerNumericComponent.java │ │ ├── FakerTextComponent.java │ │ ├── number/ │ │ │ ├── ColorComponent.java │ │ │ └── NumberComponent.java │ │ └── text/ │ │ ├── AddressComponent.java │ │ ├── InternetComponent.java │ │ ├── LoremComponent.java │ │ ├── NameComponent.java │ │ ├── PhoneComponent.java │ │ └── URLComponent.java │ └── res/ │ └── values/ │ ├── address.xml │ ├── internet.xml │ ├── lorem.xml │ ├── names.xml │ ├── phones.xml │ └── strings.xml ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── maven_push.gradle └── settings.gradle
SYMBOL INDEX (554 symbols across 61 files)
FILE: app/src/main/java/io/kimo/faker/FakerApp.java
class FakerApp (line 5) | public class FakerApp extends Application {
FILE: app/src/main/java/io/kimo/faker/mvp/BasePresenter.java
class BasePresenter (line 5) | public abstract class BasePresenter implements Presenter {
method BasePresenter (line 10) | public BasePresenter(View view, Context context) {
method createView (line 15) | @Override
method hideAllViews (line 26) | public void hideAllViews() {
method configureMainView (line 31) | public abstract void configureMainView();
FILE: app/src/main/java/io/kimo/faker/mvp/BaseView.java
class BaseView (line 10) | public abstract class BaseView extends Fragment {
method onCreateView (line 12) | @Nullable
method onStart (line 21) | @Override
method onStop (line 27) | @Override
method getLayoutResource (line 33) | public abstract int getLayoutResource();
method mapGUI (line 34) | public abstract void mapGUI(View view);
method configureGUI (line 35) | public abstract void configureGUI();
method startPresenter (line 37) | public abstract void startPresenter();
method stopPresenter (line 38) | public abstract void stopPresenter();
FILE: app/src/main/java/io/kimo/faker/mvp/Presenter.java
type Presenter (line 3) | public interface Presenter {
method createView (line 5) | void createView();
method destroyView (line 6) | void destroyView();
FILE: app/src/main/java/io/kimo/faker/mvp/View.java
type View (line 3) | public interface View {
method showFeedback (line 5) | void showFeedback(String msg);
method showView (line 7) | void showView();
method hideView (line 8) | void hideView();
method showLoading (line 10) | void showLoading();
method hideLoading (line 11) | void hideLoading();
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/AddressPresenter.java
class AddressPresenter (line 9) | public class AddressPresenter extends BasePresenter{
method AddressPresenter (line 11) | public AddressPresenter(AddressView view, Context context) {
method configureMainView (line 15) | @Override
method destroyView (line 34) | @Override
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/ColorPresenter.java
class ColorPresenter (line 9) | public class ColorPresenter extends BasePresenter{
method ColorPresenter (line 11) | public ColorPresenter(ColorView view, Context context) {
method configureMainView (line 15) | @Override
method destroyView (line 29) | @Override
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/InternetPresenter.java
class InternetPresenter (line 9) | public class InternetPresenter extends BasePresenter{
method InternetPresenter (line 11) | public InternetPresenter(InternetView view, Context context) {
method configureMainView (line 15) | @Override
method destroyView (line 25) | @Override
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/LoremPresenter.java
class LoremPresenter (line 9) | public class LoremPresenter extends BasePresenter {
method LoremPresenter (line 11) | public LoremPresenter(LoremView view, Context context) {
method configureMainView (line 15) | @Override
method destroyView (line 32) | @Override
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/NamePresenter.java
class NamePresenter (line 9) | public class NamePresenter extends BasePresenter {
method NamePresenter (line 11) | public NamePresenter(NameView view, Context context) {
method configureMainView (line 15) | @Override
method destroyView (line 28) | @Override
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/NumberPresenter.java
class NumberPresenter (line 9) | public class NumberPresenter extends BasePresenter {
method NumberPresenter (line 11) | public NumberPresenter(NumberView view, Context context) {
method configureMainView (line 15) | @Override
method destroyView (line 27) | @Override
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/PhonePresenter.java
class PhonePresenter (line 10) | public class PhonePresenter extends BasePresenter {
method PhonePresenter (line 12) | public PhonePresenter(View view, Context context) {
method configureMainView (line 16) | @Override
method destroyView (line 24) | @Override
FILE: app/src/main/java/io/kimo/faker/mvp/presenter/UrlPresenter.java
class UrlPresenter (line 9) | public class UrlPresenter extends BasePresenter{
method UrlPresenter (line 11) | public UrlPresenter(UrlView view, Context context) {
method configureMainView (line 15) | @Override
method destroyView (line 23) | @Override
FILE: app/src/main/java/io/kimo/faker/mvp/view/AddressView.java
type AddressView (line 5) | public interface AddressView extends View {
method updateCityExample (line 6) | void updateCityExample(String value);
method updateStreetExample (line 7) | void updateStreetExample(String value);
method updateSecondaryAddressExample (line 8) | void updateSecondaryAddressExample(String value);
method updateZipcodeExample (line 9) | void updateZipcodeExample(String value);
method updateTimezoneExample (line 10) | void updateTimezoneExample(String value);
method updateCityPrefixExample (line 11) | void updateCityPrefixExample(String value);
method updateCitySuffixExample (line 12) | void updateCitySuffixExample(String value);
method updateStateExample (line 13) | void updateStateExample(String value);
method updateStateAbbrvExample (line 14) | void updateStateAbbrvExample(String value);
method updateCountryExample (line 15) | void updateCountryExample(String value);
method updateCountryAbbrvExample (line 16) | void updateCountryAbbrvExample(String value);
method updateLatitudeExample (line 17) | void updateLatitudeExample(String value);
method updateLongitudeExample (line 18) | void updateLongitudeExample(String value);
FILE: app/src/main/java/io/kimo/faker/mvp/view/ColorView.java
type ColorView (line 5) | public interface ColorView extends View {
method updateRandomColorExample (line 7) | void updateRandomColorExample(int color);
method updateRedColorExample (line 9) | void updateRedColorExample(int color);
method updateGreenColorExample (line 10) | void updateGreenColorExample(int color);
method updateBlueColorExample (line 11) | void updateBlueColorExample(int color);
method updateMonochromeColorExample (line 13) | void updateMonochromeColorExample(int color);
method updateBrightColorExample (line 14) | void updateBrightColorExample(int color);
method updateLightColorExample (line 16) | void updateLightColorExample(int color);
method updateDarkColorExample (line 17) | void updateDarkColorExample(int color);
FILE: app/src/main/java/io/kimo/faker/mvp/view/InternetView.java
type InternetView (line 5) | public interface InternetView extends View {
method updateEmailExample (line 6) | void updateEmailExample(String value);
method updateURLExample (line 7) | void updateURLExample(String value);
method updateDomainExample (line 8) | void updateDomainExample(String value);
method updateDomainSuffixExample (line 9) | void updateDomainSuffixExample(String value);
FILE: app/src/main/java/io/kimo/faker/mvp/view/LoremView.java
type LoremView (line 5) | public interface LoremView extends View {
method updateCharacterExample (line 7) | void updateCharacterExample(String value);
method updateCharactersExample (line 8) | void updateCharactersExample(String value);
method updateWordExample (line 10) | void updateWordExample(String value);
method updateWordsExample (line 11) | void updateWordsExample(String value);
method updateSentenceExample (line 13) | void updateSentenceExample(String value);
method updateSentencesExample (line 14) | void updateSentencesExample(String value);
method updateParagraphExample (line 16) | void updateParagraphExample(String value);
method updateParagraphsExample (line 17) | void updateParagraphsExample(String value);
FILE: app/src/main/java/io/kimo/faker/mvp/view/NameView.java
type NameView (line 5) | public interface NameView extends View {
method updateCompleteNameExample (line 6) | void updateCompleteNameExample(String value);
method updateFullNameExample (line 7) | void updateFullNameExample(String value);
method updateFirstNameExample (line 8) | void updateFirstNameExample(String value);
method updateLastNameExample (line 9) | void updateLastNameExample(String value);
method updatePrefixExample (line 10) | void updatePrefixExample(String value);
method updateSuffixExample (line 11) | void updateSuffixExample(String value);
method updateTitleExample (line 12) | void updateTitleExample(String value);
FILE: app/src/main/java/io/kimo/faker/mvp/view/NumberView.java
type NumberView (line 5) | public interface NumberView extends View {
method updateDigit (line 6) | void updateDigit(int value);
method updatePositiveDigit (line 7) | void updatePositiveDigit(int value);
method updateNegativeDigit (line 8) | void updateNegativeDigit(int value);
method updateNumbers (line 9) | void updateNumbers(int value);
method updatePositiveNumbers (line 10) | void updatePositiveNumbers(int value);
method updateNegativeNumbers (line 11) | void updateNegativeNumbers(int value);
FILE: app/src/main/java/io/kimo/faker/mvp/view/PhoneView.java
type PhoneView (line 5) | public interface PhoneView extends View {
method updatePhoneWithAreaCodeExample (line 6) | void updatePhoneWithAreaCodeExample(String value);
method updatePhoneWithCountryCodeExample (line 7) | void updatePhoneWithCountryCodeExample(String value);
FILE: app/src/main/java/io/kimo/faker/mvp/view/UrlView.java
type UrlView (line 5) | public interface UrlView extends View {
method updateImageUrlExample (line 6) | void updateImageUrlExample(String value);
method updateAvatarUrlExample (line 7) | void updateAvatarUrlExample(String value);
FILE: app/src/main/java/io/kimo/faker/ui/activity/MainActivity.java
class MainActivity (line 40) | public class MainActivity extends AppCompatActivity {
method onCreate (line 57) | @Override
method onCreateOptionsMenu (line 70) | @Override
method onOptionsItemSelected (line 82) | @Override
method configureToolbar (line 105) | private void configureToolbar() {
method configureDrawer (line 116) | private void configureDrawer(Bundle savedInstanceState) {
method onBackPressed (line 185) | @Override
method showFragment (line 194) | private void showFragment(int flag) {
method replace (line 232) | private void replace(Fragment fragment) {
FILE: app/src/main/java/io/kimo/faker/ui/fragment/AddressFragment.java
class AddressFragment (line 12) | public class AddressFragment extends BaseView implements AddressView {
method newInstance (line 19) | public static AddressFragment newInstance() {
method updateCityExample (line 23) | @Override
method updateStreetExample (line 28) | @Override
method updateSecondaryAddressExample (line 33) | @Override
method updateZipcodeExample (line 38) | @Override
method updateTimezoneExample (line 43) | @Override
method updateCityPrefixExample (line 48) | @Override
method updateCitySuffixExample (line 53) | @Override
method updateStateExample (line 58) | @Override
method updateStateAbbrvExample (line 63) | @Override
method updateCountryExample (line 68) | @Override
method updateCountryAbbrvExample (line 73) | @Override
method updateLatitudeExample (line 78) | @Override
method updateLongitudeExample (line 83) | @Override
method getLayoutResource (line 88) | @Override
method mapGUI (line 93) | @Override
method configureGUI (line 113) | @Override
method startPresenter (line 118) | @Override
method stopPresenter (line 124) | @Override
method showFeedback (line 129) | @Override
method showView (line 134) | @Override
method hideView (line 139) | @Override
method showLoading (line 144) | @Override
method hideLoading (line 149) | @Override
FILE: app/src/main/java/io/kimo/faker/ui/fragment/ColorFragment.java
class ColorFragment (line 11) | public class ColorFragment extends BaseView implements ColorView {
method newInstance (line 17) | public static ColorFragment newInstance() {
method getLayoutResource (line 21) | @Override
method mapGUI (line 26) | @Override
method configureGUI (line 40) | @Override
method startPresenter (line 45) | @Override
method stopPresenter (line 51) | @Override
method updateRandomColorExample (line 56) | @Override
method updateRedColorExample (line 61) | @Override
method updateGreenColorExample (line 66) | @Override
method updateBlueColorExample (line 71) | @Override
method updateMonochromeColorExample (line 76) | @Override
method updateBrightColorExample (line 81) | @Override
method updateLightColorExample (line 86) | @Override
method updateDarkColorExample (line 91) | @Override
method showFeedback (line 96) | @Override
method showView (line 101) | @Override
method hideView (line 106) | @Override
method showLoading (line 111) | @Override
method hideLoading (line 116) | @Override
FILE: app/src/main/java/io/kimo/faker/ui/fragment/InternetFragment.java
class InternetFragment (line 12) | public class InternetFragment extends BaseView implements InternetView {
method newInstance (line 19) | public static InternetFragment newInstance() {
method getLayoutResource (line 23) | @Override
method mapGUI (line 28) | @Override
method configureGUI (line 38) | @Override
method startPresenter (line 43) | @Override
method stopPresenter (line 49) | @Override
method updateEmailExample (line 54) | @Override
method updateURLExample (line 59) | @Override
method updateDomainExample (line 64) | @Override
method updateDomainSuffixExample (line 69) | @Override
method showFeedback (line 74) | @Override
method showView (line 79) | @Override
method hideView (line 84) | @Override
method showLoading (line 89) | @Override
method hideLoading (line 94) | @Override
FILE: app/src/main/java/io/kimo/faker/ui/fragment/LoremFragment.java
class LoremFragment (line 12) | public class LoremFragment extends BaseView implements LoremView {
method newInstance (line 19) | public static LoremFragment newInstance() {
method getLayoutResource (line 23) | @Override
method mapGUI (line 28) | @Override
method configureGUI (line 47) | @Override
method startPresenter (line 52) | @Override
method stopPresenter (line 58) | @Override
method updateCharacterExample (line 63) | @Override
method updateCharactersExample (line 68) | @Override
method updateWordExample (line 73) | @Override
method updateWordsExample (line 78) | @Override
method updateSentenceExample (line 83) | @Override
method updateSentencesExample (line 88) | @Override
method updateParagraphExample (line 93) | @Override
method updateParagraphsExample (line 98) | @Override
method showFeedback (line 103) | @Override
method showView (line 108) | @Override
method hideView (line 113) | @Override
method showLoading (line 118) | @Override
method hideLoading (line 123) | @Override
FILE: app/src/main/java/io/kimo/faker/ui/fragment/NameFragment.java
class NameFragment (line 12) | public class NameFragment extends BaseView implements NameView {
method newInstance (line 19) | public static NameFragment newInstance() {
method getLayoutResource (line 23) | @Override
method mapGUI (line 28) | @Override
method configureGUI (line 41) | @Override
method startPresenter (line 46) | @Override
method stopPresenter (line 52) | @Override
method showFeedback (line 57) | @Override
method showView (line 62) | @Override
method hideView (line 67) | @Override
method showLoading (line 72) | @Override
method hideLoading (line 77) | @Override
method updateCompleteNameExample (line 82) | @Override
method updateFullNameExample (line 87) | @Override
method updateFirstNameExample (line 92) | @Override
method updateLastNameExample (line 97) | @Override
method updatePrefixExample (line 102) | @Override
method updateSuffixExample (line 107) | @Override
method updateTitleExample (line 112) | @Override
FILE: app/src/main/java/io/kimo/faker/ui/fragment/NumberFragment.java
class NumberFragment (line 12) | public class NumberFragment extends BaseView implements NumberView {
method newInstance (line 19) | public static NumberFragment newInstance() {
method getLayoutResource (line 23) | @Override
method mapGUI (line 28) | @Override
method configureGUI (line 40) | @Override
method startPresenter (line 45) | @Override
method stopPresenter (line 51) | @Override
method showFeedback (line 56) | @Override
method showView (line 61) | @Override
method hideView (line 66) | @Override
method showLoading (line 71) | @Override
method hideLoading (line 76) | @Override
method updateDigit (line 81) | @Override
method updatePositiveDigit (line 86) | @Override
method updateNegativeDigit (line 91) | @Override
method updateNumbers (line 96) | @Override
method updatePositiveNumbers (line 101) | @Override
method updateNegativeNumbers (line 106) | @Override
FILE: app/src/main/java/io/kimo/faker/ui/fragment/PhoneFragment.java
class PhoneFragment (line 12) | public class PhoneFragment extends BaseView implements PhoneView {
method newInstance (line 19) | public static PhoneFragment newInstance() {
method getLayoutResource (line 23) | @Override
method mapGUI (line 28) | @Override
method configureGUI (line 36) | @Override
method startPresenter (line 41) | @Override
method stopPresenter (line 47) | @Override
method updatePhoneWithAreaCodeExample (line 52) | @Override
method updatePhoneWithCountryCodeExample (line 57) | @Override
method showFeedback (line 62) | @Override
method showView (line 67) | @Override
method hideView (line 72) | @Override
method showLoading (line 77) | @Override
method hideLoading (line 82) | @Override
FILE: app/src/main/java/io/kimo/faker/ui/fragment/ProfileFragment.java
class ProfileFragment (line 17) | public class ProfileFragment extends Fragment {
method onCreateView (line 22) | @Nullable
method onActivityCreated (line 37) | @Override
FILE: app/src/main/java/io/kimo/faker/ui/fragment/TargetViewsFragment.java
class TargetViewsFragment (line 13) | public class TargetViewsFragment extends Fragment {
method onCreateView (line 17) | @Nullable
method onActivityCreated (line 24) | @Override
FILE: app/src/main/java/io/kimo/faker/ui/fragment/UrlFragment.java
class UrlFragment (line 16) | public class UrlFragment extends BaseView implements UrlView {
method newInstance (line 24) | public static UrlFragment newInstance() {
method getLayoutResource (line 28) | @Override
method mapGUI (line 33) | @Override
method configureGUI (line 45) | @Override
method startPresenter (line 50) | @Override
method stopPresenter (line 56) | @Override
method updateImageUrlExample (line 61) | @Override
method updateAvatarUrlExample (line 72) | @Override
method showFeedback (line 83) | @Override
method showView (line 88) | @Override
method hideView (line 93) | @Override
method showLoading (line 98) | @Override
method hideLoading (line 103) | @Override
FILE: app/src/main/java/io/kimo/faker/ui/fragment/WidgetsFragment.java
class WidgetsFragment (line 13) | public class WidgetsFragment extends Fragment {
method onCreateView (line 17) | @Nullable
method onActivityCreated (line 24) | @Override
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/number/NumberComponentTest.java
class NumberComponentTest (line 8) | public class NumberComponentTest extends AndroidTestCase {
method setUp (line 12) | @Before
method testDigit (line 17) | @Test
method testPositiveDigit (line 25) | @Test
method testNegativeDigit (line 33) | @Test
method testNumbers (line 41) | @Test
method testNumbersWithArguments (line 53) | @Test
method testNumbersWithInvalidArguments (line 61) | @Test
method testPositiveNumbers (line 71) | @Test
method testNegativeNumbers (line 77) | @Test
method testRandomNumber (line 83) | @Test
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/AddressComponentTest.java
class AddressComponentTest (line 13) | public class AddressComponentTest extends AndroidTestCase {
method setUp (line 18) | @Before
method testCity (line 35) | @Test
method testStreet (line 76) | @Test
method testStreetWithNumber (line 106) | @Test
method testSecondaryAddress (line 113) | @Test
method testBuildingNumber (line 128) | @Test
method testZipCodeAndPostCode (line 135) | @Test
method testTimeZone (line 144) | @Test
method testCitySuffix (line 159) | @Test
method testCityPrefix (line 166) | @Test
method testState (line 173) | @Test
method testStateAbbreviation (line 188) | @Test
method testCountry (line 203) | @Test
method testCountryAbbreviation (line 218) | @Test
method testLatitudeAndLongitude (line 233) | @Test
method testRandomText (line 244) | @Test
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/InternetComponentTest.java
class InternetComponentTest (line 15) | public class InternetComponentTest extends AndroidTestCase {
method setUp (line 25) | @Before
method testEmail (line 33) | @Test
method testEmailWithArguments (line 43) | @Test
method testDomainSuffix (line 59) | @Test
method testDomainSuffixWithArguments (line 66) | @Test
method testDomain (line 74) | @Test
method testUrl (line 83) | @Test
method testUrlWithArguments (line 92) | @Test
method testRandomText (line 105) | @Test
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/LoremComponentTest.java
class LoremComponentTest (line 16) | public class LoremComponentTest extends AndroidTestCase {
method setUp (line 23) | @Before
method testWord (line 30) | @Test
method testWords (line 35) | @Test
method testWordsWithArguments (line 44) | @Test
method testWordsWithInvalidArguments (line 51) | @Test
method testSentence (line 61) | @Test
method testSentences (line 72) | @Test
method testSentencesWithArguments (line 79) | @Test
method testSentencesWithInvalidArguments (line 86) | @Test
method testCharacter (line 96) | @Test
method testCharacters (line 104) | @Test
method testCharactersWithArguments (line 112) | @Test
method testCharactersInvalidArguments (line 118) | @Test
method testParagraph (line 128) | @Test
method testParagraphs (line 137) | @Test
method testParagraphsWithArguments (line 144) | @Test
method testParagraphsWithInvalidArguments (line 153) | @Test
method testRandomText (line 163) | @Test
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/NameComponentTest.java
class NameComponentTest (line 15) | public class NameComponentTest extends AndroidTestCase {
method setUp (line 20) | @Before
method testFirstName (line 32) | @Test
method testLastName (line 39) | @Test
method testFullName (line 46) | @Test
method testCompleteName (line 58) | @Test
method testPrefix (line 74) | @Test
method testSuffix (line 81) | @Test
method testTitle (line 88) | @Test
method testRandomText (line 102) | @Test
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/PhoneComponentTest.java
class PhoneComponentTest (line 9) | public class PhoneComponentTest extends AndroidTestCase {
method setUp (line 13) | @Before
method testPhoneWithAreaCode (line 18) | @Test
method testPhoneWithCountryCode (line 26) | @Test
method testRandomText (line 33) | @Test
FILE: faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/UrlComponentTest.java
class UrlComponentTest (line 10) | public class UrlComponentTest extends AndroidTestCase {
method setUp (line 17) | @Before
method testImage (line 23) | @Test
method testImageWithArguments (line 30) | @Test
method testAvatar (line 41) | @Test
method testAvatarWithArguments (line 48) | @Test
FILE: faker-core/src/main/java/io/kimo/lib/faker/Faker.java
class Faker (line 28) | public class Faker {
method with (line 43) | public static Faker with(Context context) {
method Faker (line 59) | private Faker(Context context) {
method fill (line 74) | public void fill(View view) {
method fillWithText (line 103) | public void fillWithText(TextView view, FakerTextComponent component) {
method targetViews (line 115) | public Faker targetViews(Integer...ids) {
method fillWithNumber (line 125) | public void fillWithNumber(TextView view, FakerNumericComponent compon...
method fillWithColor (line 138) | public void fillWithColor(View view, FakerColorComponent component) {
method fillWithCheckState (line 149) | public void fillWithCheckState(CompoundButton view) {
method fillOnAndOffWithText (line 161) | public void fillOnAndOffWithText(ToggleButton view, FakerTextComponent...
method fillWithProgress (line 177) | public void fillWithProgress(ProgressBar view, FakerNumericComponent c...
method fillView (line 185) | private void fillView(View view) {
method validateIfIsACompoundButton (line 207) | private void validateIfIsACompoundButton(View view) {
method validateIfIsATextView (line 212) | private void validateIfIsATextView(View view) {
method validateNotNullableView (line 217) | private void validateNotNullableView(View view) {
method validateNotNullableFakerComponent (line 223) | private void validateNotNullableFakerComponent(FakerCoreComponent comp...
method validateIfIsAToggleButton (line 229) | private void validateIfIsAToggleButton(View view) {
method validateIfIsAProgressBar (line 235) | private void validateIfIsAProgressBar(View view) {
FILE: faker-core/src/main/java/io/kimo/lib/faker/FakerCoreComponent.java
class FakerCoreComponent (line 5) | public abstract class FakerCoreComponent {
method FakerCoreComponent (line 9) | public FakerCoreComponent(Context context) {
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/AddressAPI.java
type AddressAPI (line 3) | public interface AddressAPI {
method city (line 5) | String city();
method street (line 6) | String street();
method streetWithNumber (line 7) | String streetWithNumber();
method secondaryAddress (line 8) | String secondaryAddress();
method buildingNumber (line 9) | String buildingNumber();
method zipCode (line 10) | String zipCode();
method postCode (line 11) | String postCode();
method timeZone (line 12) | String timeZone();
method citySuffix (line 13) | String citySuffix();
method cityPrefix (line 14) | String cityPrefix();
method state (line 15) | String state();
method stateAbbreviation (line 16) | String stateAbbreviation();
method country (line 17) | String country();
method countryAbbreviation (line 18) | String countryAbbreviation();
method latitude (line 19) | String latitude();
method longitude (line 20) | String longitude();
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/ColorAPI.java
type ColorAPI (line 3) | public interface ColorAPI {
method redColor (line 5) | int redColor();
method redColors (line 6) | int [] redColors(int numberOfRedColors);
method greenColor (line 8) | int greenColor();
method greenColors (line 9) | int [] greenColors(int numberOfGreenColors);
method blueColor (line 11) | int blueColor();
method blueColors (line 12) | int [] blueColors(int numberOfBlueColors);
method monochromeColor (line 14) | int monochromeColor();
method brightColor (line 15) | int brightColor();
method lightColor (line 17) | int lightColor();
method darkColor (line 18) | int darkColor();
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/InternetAPI.java
type InternetAPI (line 3) | public interface InternetAPI {
method email (line 5) | String email();
method email (line 6) | String email(String name, String domain, String suffix);
method domain (line 8) | String domain();
method domainSuffix (line 9) | String domainSuffix();
method domainSuffix (line 10) | String domainSuffix(String suffix);
method url (line 12) | String url();
method url (line 13) | String url(String domain, String suffix);
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/LoremAPI.java
type LoremAPI (line 3) | public interface LoremAPI {
method character (line 5) | String character();
method characters (line 6) | String characters();
method characters (line 7) | String characters(int numberOfCharacters);
method word (line 9) | String word();
method words (line 10) | String words();
method words (line 11) | String words(int numberOfWords);
method sentence (line 13) | String sentence();
method sentences (line 14) | String sentences();
method sentences (line 15) | String sentences(int numberOfSentences);
method paragraph (line 17) | String paragraph();
method paragraphs (line 18) | String paragraphs();
method paragraphs (line 19) | String paragraphs(int numberOfParagraphs);
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/NameAPI.java
type NameAPI (line 3) | public interface NameAPI {
method firstName (line 5) | String firstName();
method lastName (line 6) | String lastName();
method fullName (line 7) | String fullName();
method completeName (line 8) | String completeName();
method prefix (line 9) | String prefix();
method suffix (line 10) | String suffix();
method title (line 11) | String title();
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/NumberAPI.java
type NumberAPI (line 5) | public interface NumberAPI {
method setSeed (line 7) | void setSeed(Random random);
method digit (line 9) | int digit();
method positiveDigit (line 10) | int positiveDigit();
method negativeDigit (line 11) | int negativeDigit();
method number (line 12) | int number();
method number (line 13) | int number(int amountOfDigits);
method positiveNumber (line 14) | int positiveNumber();
method negativeNumber (line 15) | int negativeNumber();
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/PhoneAPI.java
type PhoneAPI (line 3) | public interface PhoneAPI {
method phoneWithAreaCode (line 5) | String phoneWithAreaCode();
method phoneWithCountryCode (line 6) | String phoneWithCountryCode();
FILE: faker-core/src/main/java/io/kimo/lib/faker/api/UrlAPI.java
type UrlAPI (line 3) | public interface UrlAPI {
method image (line 4) | String image();
method image (line 5) | String image(int width, int height);
method avatar (line 7) | String avatar();
method avatar (line 8) | String avatar(int width, int height);
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/FakerColorComponent.java
class FakerColorComponent (line 5) | public abstract class FakerColorComponent extends FakerNumericComponent {
method FakerColorComponent (line 7) | public FakerColorComponent(Context context) {
method randomColor (line 11) | public abstract int randomColor();
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/FakerNumericComponent.java
class FakerNumericComponent (line 7) | public abstract class FakerNumericComponent extends FakerCoreComponent {
method FakerNumericComponent (line 9) | public FakerNumericComponent(Context context) {
method randomNumber (line 13) | public abstract Number randomNumber();
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/FakerTextComponent.java
class FakerTextComponent (line 7) | public abstract class FakerTextComponent extends FakerCoreComponent {
method FakerTextComponent (line 9) | public FakerTextComponent(Context context) {
method randomText (line 13) | public abstract String randomText();
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/number/ColorComponent.java
class ColorComponent (line 13) | public class ColorComponent extends FakerColorComponent implements Color...
method ColorComponent (line 15) | public ColorComponent(Context context) {
method randomNumber (line 19) | @Override
method randomColor (line 24) | @Override
method redColor (line 30) | @Override
method redColors (line 35) | @Override
method greenColor (line 40) | @Override
method greenColors (line 45) | @Override
method blueColor (line 50) | @Override
method blueColors (line 55) | @Override
method monochromeColor (line 60) | @Override
method brightColor (line 65) | @Override
method lightColor (line 70) | @Override
method darkColor (line 75) | @Override
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/number/NumberComponent.java
class NumberComponent (line 10) | public class NumberComponent extends FakerNumericComponent implements Nu...
method NumberComponent (line 14) | public NumberComponent(Context context) {
method randomNumber (line 18) | @Override
method randomNumberInRangePositiveOrNegative (line 40) | private int randomNumberInRangePositiveOrNegative(int min, int max) {
method setSeed (line 44) | @Override
method getSeed (line 49) | public Random getSeed() {
method digit (line 53) | @Override
method positiveDigit (line 58) | @Override
method negativeDigit (line 63) | @Override
method number (line 68) | @Override
method number (line 80) | @Override
method positiveNumber (line 96) | @Override
method negativeNumber (line 101) | @Override
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/AddressComponent.java
class AddressComponent (line 14) | public class AddressComponent extends FakerTextComponent implements Addr...
method AddressComponent (line 20) | public AddressComponent(Context context) {
method numbersInMask (line 36) | private String numbersInMask(String mask, char maskPlaceholder) {
method city (line 53) | @Override
method street (line 89) | @Override
method streetWithNumber (line 100) | @Override
method secondaryAddress (line 105) | @Override
method buildingNumber (line 110) | @Override
method zipCode (line 115) | @Override
method postCode (line 121) | @Override
method timeZone (line 126) | @Override
method citySuffix (line 131) | @Override
method cityPrefix (line 136) | @Override
method state (line 141) | @Override
method stateAbbreviation (line 146) | @Override
method country (line 151) | @Override
method countryAbbreviation (line 156) | @Override
method latitude (line 161) | @Override
method longitude (line 166) | @Override
method randomText (line 171) | @Override
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/InternetComponent.java
class InternetComponent (line 13) | public class InternetComponent extends FakerTextComponent implements Int...
method InternetComponent (line 18) | public InternetComponent(Context context) {
method randomText (line 24) | @Override
method email (line 42) | @Override
method email (line 47) | @Override
method domain (line 52) | @Override
method domainSuffix (line 57) | @Override
method domainSuffix (line 62) | @Override
method url (line 67) | @Override
method url (line 72) | @Override
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/LoremComponent.java
class LoremComponent (line 15) | public class LoremComponent extends FakerTextComponent implements LoremA...
method LoremComponent (line 25) | public LoremComponent(Context context) {
method randomText (line 30) | @Override
method word (line 53) | @Override
method words (line 63) | @Override
method words (line 74) | @Override
method sentence (line 90) | @Override
method sentences (line 96) | @Override
method sentences (line 102) | @Override
method character (line 118) | @Override
method characters (line 123) | @Override
method characters (line 128) | @Override
method paragraph (line 144) | @Override
method paragraphs (line 149) | @Override
method paragraphs (line 155) | @Override
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/NameComponent.java
class NameComponent (line 13) | public class NameComponent extends FakerTextComponent implements NameAPI {
method NameComponent (line 17) | public NameComponent(Context context) {
method randomText (line 28) | @Override
method firstName (line 54) | @Override
method lastName (line 59) | @Override
method fullName (line 64) | @Override
method completeName (line 69) | @Override
method prefix (line 74) | @Override
method suffix (line 79) | @Override
method title (line 84) | @Override
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/PhoneComponent.java
class PhoneComponent (line 12) | public class PhoneComponent extends FakerTextComponent implements PhoneA...
method PhoneComponent (line 17) | public PhoneComponent(Context context) {
method randomText (line 24) | @Override
method numbersInMask (line 38) | private String numbersInMask(String mask, char maskPlaceholder) {
method phoneWithAreaCode (line 55) | @Override
method phoneWithCountryCode (line 60) | @Override
FILE: faker-core/src/main/java/io/kimo/lib/faker/component/text/URLComponent.java
class URLComponent (line 8) | public class URLComponent extends FakerTextComponent implements UrlAPI {
method URLComponent (line 16) | public URLComponent(Context context) {
method randomText (line 21) | @Override
method image (line 35) | @Override
method image (line 40) | @Override
method avatar (line 45) | @Override
method avatar (line 50) | @Override
Condensed preview — 108 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (354K chars).
[
{
"path": ".gitignore",
"chars": 324,
"preview": "# Built application files\n*.apk\n*.ap_\n\n# Files for the Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated files\nbi"
},
{
"path": ".travis.yml",
"chars": 624,
"preview": "language: android\n\njdk: oraclejdk7\n\nenv:\n global:\n - ADB_INSTALL_TIMEOUT=8\n\nenv:\n matrix:\n - ANDROID_TARGET=10 A"
},
{
"path": "LICENSE",
"chars": 11323,
"preview": "Apache License\n Version 2.0, January 2004\n http://www.apache.org/licens"
},
{
"path": "README.md",
"chars": 5497,
"preview": "# Faker\n[](https://android-"
},
{
"path": "app/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "app/build.gradle",
"chars": 815,
"preview": "apply plugin: 'com.android.application'\n\nandroid {\n compileSdkVersion 22\n buildToolsVersion '26.0.0'\n\n defaultC"
},
{
"path": "app/proguard-rules.pro",
"chars": 654,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
},
{
"path": "app/src/main/AndroidManifest.xml",
"chars": 841,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package="
},
{
"path": "app/src/main/java/io/kimo/faker/FakerApp.java",
"chars": 103,
"preview": "package io.kimo.faker;\n\nimport android.app.Application;\n\npublic class FakerApp extends Application {\n}\n"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/BasePresenter.java",
"chars": 627,
"preview": "package io.kimo.faker.mvp;\n\nimport android.content.Context;\n\npublic abstract class BasePresenter implements Presenter {\n"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/BaseView.java",
"chars": 981,
"preview": "package io.kimo.faker.mvp;\n\nimport android.os.Bundle;\nimport android.support.annotation.Nullable;\nimport android.support"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/Presenter.java",
"chars": 107,
"preview": "package io.kimo.faker.mvp;\n\npublic interface Presenter {\n\n void createView();\n void destroyView();\n}\n"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/View.java",
"chars": 182,
"preview": "package io.kimo.faker.mvp;\n\npublic interface View {\n\n void showFeedback(String msg);\n\n void showView();\n void h"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/presenter/AddressPresenter.java",
"chars": 1621,
"preview": "package io.kimo.faker.mvp.presenter;\n\nimport android.content.Context;\n\nimport io.kimo.faker.mvp.BasePresenter;\nimport io"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/presenter/ColorPresenter.java",
"chars": 1168,
"preview": "package io.kimo.faker.mvp.presenter;\n\nimport android.content.Context;\n\nimport io.kimo.faker.mvp.BasePresenter;\nimport io"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/presenter/InternetPresenter.java",
"chars": 841,
"preview": "package io.kimo.faker.mvp.presenter;\n\nimport android.content.Context;\n\nimport io.kimo.faker.mvp.BasePresenter;\nimport io"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/presenter/LoremPresenter.java",
"chars": 1128,
"preview": "package io.kimo.faker.mvp.presenter;\n\nimport android.content.Context;\n\nimport io.kimo.faker.mvp.BasePresenter;\nimport io"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/presenter/NamePresenter.java",
"chars": 1021,
"preview": "package io.kimo.faker.mvp.presenter;\n\nimport android.content.Context;\n\nimport io.kimo.faker.mvp.BasePresenter;\nimport io"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/presenter/NumberPresenter.java",
"chars": 981,
"preview": "package io.kimo.faker.mvp.presenter;\n\nimport android.content.Context;\n\nimport io.kimo.faker.mvp.BasePresenter;\nimport io"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/presenter/PhonePresenter.java",
"chars": 719,
"preview": "package io.kimo.faker.mvp.presenter;\n\nimport android.content.Context;\n\nimport io.kimo.faker.mvp.BasePresenter;\nimport io"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/presenter/UrlPresenter.java",
"chars": 630,
"preview": "package io.kimo.faker.mvp.presenter;\n\nimport android.content.Context;\n\nimport io.kimo.faker.mvp.BasePresenter;\nimport io"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/view/AddressView.java",
"chars": 717,
"preview": "package io.kimo.faker.mvp.view;\n\nimport io.kimo.faker.mvp.View;\n\npublic interface AddressView extends View {\n void up"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/view/ColorView.java",
"chars": 476,
"preview": "package io.kimo.faker.mvp.view;\n\nimport io.kimo.faker.mvp.View;\n\npublic interface ColorView extends View {\n\n void upd"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/view/InternetView.java",
"chars": 290,
"preview": "package io.kimo.faker.mvp.view;\n\nimport io.kimo.faker.mvp.View;\n\npublic interface InternetView extends View {\n void u"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/view/LoremView.java",
"chars": 481,
"preview": "package io.kimo.faker.mvp.view;\n\nimport io.kimo.faker.mvp.View;\n\npublic interface LoremView extends View {\n\n void upd"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/view/NameView.java",
"chars": 428,
"preview": "package io.kimo.faker.mvp.view;\n\nimport io.kimo.faker.mvp.View;\n\npublic interface NameView extends View {\n void updat"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/view/NumberView.java",
"chars": 346,
"preview": "package io.kimo.faker.mvp.view;\n\nimport io.kimo.faker.mvp.View;\n\npublic interface NumberView extends View {\n void upd"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/view/PhoneView.java",
"chars": 222,
"preview": "package io.kimo.faker.mvp.view;\n\nimport io.kimo.faker.mvp.View;\n\npublic interface PhoneView extends View {\n void upda"
},
{
"path": "app/src/main/java/io/kimo/faker/mvp/view/UrlView.java",
"chars": 200,
"preview": "package io.kimo.faker.mvp.view;\n\nimport io.kimo.faker.mvp.View;\n\npublic interface UrlView extends View {\n void update"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/activity/MainActivity.java",
"chars": 9754,
"preview": "package io.kimo.faker.ui.activity;\n\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.support.v4.a"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/fragment/AddressFragment.java",
"chars": 4152,
"preview": "package io.kimo.faker.ui.fragment;\n\nimport android.view.View;\nimport android.widget.TextView;\nimport android.widget.Toas"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/fragment/ColorFragment.java",
"chars": 3030,
"preview": "package io.kimo.faker.ui.fragment;\n\nimport android.view.View;\nimport android.widget.Toast;\n\nimport io.kimo.faker.R;\nimpo"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/fragment/InternetFragment.java",
"chars": 2397,
"preview": "package io.kimo.faker.ui.fragment;\n\nimport android.view.View;\nimport android.widget.TextView;\nimport android.widget.Toas"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/fragment/LoremFragment.java",
"chars": 3177,
"preview": "package io.kimo.faker.ui.fragment;\n\nimport android.view.View;\nimport android.widget.TextView;\nimport android.widget.Toas"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/fragment/NameFragment.java",
"chars": 2926,
"preview": "package io.kimo.faker.ui.fragment;\n\nimport android.view.View;\nimport android.widget.TextView;\nimport android.widget.Toas"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/fragment/NumberFragment.java",
"chars": 2908,
"preview": "package io.kimo.faker.ui.fragment;\n\nimport android.view.View;\nimport android.widget.TextView;\nimport android.widget.Toas"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/fragment/PhoneFragment.java",
"chars": 2079,
"preview": "package io.kimo.faker.ui.fragment;\n\nimport android.view.View;\nimport android.widget.TextView;\nimport android.widget.Toas"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/fragment/ProfileFragment.java",
"chars": 1921,
"preview": "package io.kimo.faker.ui.fragment;\n\nimport android.os.Bundle;\nimport android.support.annotation.Nullable;\nimport android"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/fragment/TargetViewsFragment.java",
"chars": 951,
"preview": "package io.kimo.faker.ui.fragment;\n\nimport android.os.Bundle;\nimport android.support.annotation.Nullable;\nimport android"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/fragment/UrlFragment.java",
"chars": 2812,
"preview": "package io.kimo.faker.ui.fragment;\n\nimport android.view.View;\nimport android.widget.ImageView;\nimport android.widget.Tex"
},
{
"path": "app/src/main/java/io/kimo/faker/ui/fragment/WidgetsFragment.java",
"chars": 867,
"preview": "package io.kimo.faker.ui.fragment;\n\nimport android.os.Bundle;\nimport android.support.annotation.Nullable;\nimport android"
},
{
"path": "app/src/main/res/layout/activity_with_toolbar.xml",
"chars": 839,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xm"
},
{
"path": "app/src/main/res/layout/fragment_address.xml",
"chars": 6466,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/fragment_color.xml",
"chars": 3571,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "app/src/main/res/layout/fragment_internet.xml",
"chars": 2539,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/fragment_lorem.xml",
"chars": 4341,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/fragment_name.xml",
"chars": 3844,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/fragment_number.xml",
"chars": 3418,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/fragment_phone.xml",
"chars": 1745,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/fragment_profile.xml",
"chars": 5345,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/fragment_target_views.xml",
"chars": 2377,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "app/src/main/res/layout/fragment_url.xml",
"chars": 2174,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/fragment_widgets.xml",
"chars": 3235,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/header_drawer.xml",
"chars": 301,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "app/src/main/res/layout/view_loading.xml",
"chars": 523,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "app/src/main/res/menu/menu_main.xml",
"chars": 344,
"preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\" xmln"
},
{
"path": "app/src/main/res/values/colors.xml",
"chars": 226,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"faker_primary_color\">#FF9800</color>\n <color name"
},
{
"path": "app/src/main/res/values/dimens.xml",
"chars": 211,
"preview": "<resources>\n <!-- Default screen margins, per the Android Design guidelines. -->\n <dimen name=\"activity_horizontal"
},
{
"path": "app/src/main/res/values/strings.xml",
"chars": 146,
"preview": "<resources>\n <string name=\"app_name\">Faker</string>\n <string name=\"open\">Open</string>\n <string name=\"close\">Cl"
},
{
"path": "app/src/main/res/values/styles.xml",
"chars": 1075,
"preview": "<resources>\n\n <style name=\"AppTheme\" parent=\"AppTheme.Base\"/>\n\n <style name=\"AppTheme.Base\" parent=\"Theme.AppCompa"
},
{
"path": "app/src/main/res/values-v21/styles.xml",
"chars": 216,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <style name=\"AppTheme\" parent=\"AppTheme.Base\">\n "
},
{
"path": "app/src/main/res/values-w820dp/dimens.xml",
"chars": 358,
"preview": "<resources>\n <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n (such as s"
},
{
"path": "build.gradle",
"chars": 442,
"preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n r"
},
{
"path": "faker-core/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "faker-core/build.gradle",
"chars": 899,
"preview": "apply plugin: 'com.android.library'\n\nandroid {\n compileSdkVersion 22\n buildToolsVersion '26.0.1'\n\n defaultConfi"
},
{
"path": "faker-core/proguard-rules.pro",
"chars": 654,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
},
{
"path": "faker-core/src/androidTest/java/io/kimo/lib/faker/component/number/NumberComponentTest.java",
"chars": 2214,
"preview": "package io.kimo.lib.faker.component.number;\n\nimport android.test.AndroidTestCase;\n\nimport org.junit.Before;\nimport org.j"
},
{
"path": "faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/AddressComponentTest.java",
"chars": 7747,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.test.AndroidTestCase;\n\nimport org.junit.Before;\nimport org.jun"
},
{
"path": "faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/InternetComponentTest.java",
"chars": 3746,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.test.AndroidTestCase;\nimport android.text.TextUtils;\nimport an"
},
{
"path": "faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/LoremComponentTest.java",
"chars": 4833,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.test.AndroidTestCase;\nimport android.text.TextUtils;\n\nimport o"
},
{
"path": "faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/NameComponentTest.java",
"chars": 3658,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.test.AndroidTestCase;\nimport android.text.TextUtils;\n\nimport o"
},
{
"path": "faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/PhoneComponentTest.java",
"chars": 984,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.test.AndroidTestCase;\nimport android.text.TextUtils;\n\nimport o"
},
{
"path": "faker-core/src/androidTest/java/io/kimo/lib/faker/component/text/UrlComponentTest.java",
"chars": 1742,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.test.AndroidTestCase;\n\nimport org.junit.Before;\nimport org.jun"
},
{
"path": "faker-core/src/main/AndroidManifest.xml",
"chars": 210,
"preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\" package=\"io.kimo.lib.faker\">\n\n <application andr"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/Faker.java",
"chars": 7243,
"preview": "package io.kimo.lib.faker;\n\nimport android.content.Context;\nimport android.view.View;\nimport android.view.ViewGroup;\nimp"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/FakerCoreComponent.java",
"chars": 343,
"preview": "package io.kimo.lib.faker;\n\nimport android.content.Context;\n\npublic abstract class FakerCoreComponent {\n\n protected C"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/api/AddressAPI.java",
"chars": 469,
"preview": "package io.kimo.lib.faker.api;\n\npublic interface AddressAPI {\n\n String city();\n String street();\n String street"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/api/ColorAPI.java",
"chars": 364,
"preview": "package io.kimo.lib.faker.api;\n\npublic interface ColorAPI {\n\n int redColor();\n int [] redColors(int numberOfRedCol"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/api/InternetAPI.java",
"chars": 301,
"preview": "package io.kimo.lib.faker.api;\n\npublic interface InternetAPI {\n\n String email();\n String email(String name, String"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/api/LoremAPI.java",
"chars": 426,
"preview": "package io.kimo.lib.faker.api;\n\npublic interface LoremAPI {\n\n String character();\n String characters();\n String"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/api/NameAPI.java",
"chars": 221,
"preview": "package io.kimo.lib.faker.api;\n\npublic interface NameAPI {\n\n String firstName();\n String lastName();\n String fu"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/api/NumberAPI.java",
"chars": 297,
"preview": "package io.kimo.lib.faker.api;\n\nimport java.util.Random;\n\npublic interface NumberAPI {\n\n void setSeed(Random random);"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/api/PhoneAPI.java",
"chars": 130,
"preview": "package io.kimo.lib.faker.api;\n\npublic interface PhoneAPI {\n\n String phoneWithAreaCode();\n String phoneWithCountry"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/api/UrlAPI.java",
"chars": 185,
"preview": "package io.kimo.lib.faker.api;\n\npublic interface UrlAPI {\n String image();\n String image(int width, int height);\n\n"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/component/FakerColorComponent.java",
"chars": 268,
"preview": "package io.kimo.lib.faker.component;\n\nimport android.content.Context;\n\npublic abstract class FakerColorComponent extends"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/component/FakerNumericComponent.java",
"chars": 319,
"preview": "package io.kimo.lib.faker.component;\n\nimport android.content.Context;\n\nimport io.kimo.lib.faker.FakerCoreComponent;\n\npub"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/component/FakerTextComponent.java",
"chars": 311,
"preview": "package io.kimo.lib.faker.component;\n\nimport android.content.Context;\n\nimport io.kimo.lib.faker.FakerCoreComponent;\n\npub"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/component/number/ColorComponent.java",
"chars": 2245,
"preview": "package io.kimo.lib.faker.component.number;\n\nimport android.content.Context;\n\nimport com.github.lzyzsd.randomcolor.Rando"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/component/number/NumberComponent.java",
"chars": 2519,
"preview": "package io.kimo.lib.faker.component.number;\n\nimport android.content.Context;\n\nimport java.util.Random;\n\nimport io.kimo.l"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/component/text/AddressComponent.java",
"chars": 6406,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.content.Context;\n\nimport java.util.Arrays;\nimport java.util.Li"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/component/text/InternetComponent.java",
"chars": 1946,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.content.Context;\n\nimport java.util.Arrays;\nimport java.util.Li"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/component/text/LoremComponent.java",
"chars": 4760,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.content.Context;\nimport android.text.TextUtils;\n\nimport java.u"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/component/text/NameComponent.java",
"chars": 2828,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.content.Context;\n\nimport java.util.Arrays;\nimport java.util.Li"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/component/text/PhoneComponent.java",
"chars": 1801,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.content.Context;\n\nimport java.lang.*;\n\nimport io.kimo.lib.fake"
},
{
"path": "faker-core/src/main/java/io/kimo/lib/faker/component/text/URLComponent.java",
"chars": 1420,
"preview": "package io.kimo.lib.faker.component.text;\n\nimport android.content.Context;\n\nimport io.kimo.lib.faker.api.UrlAPI;\nimport "
},
{
"path": "faker-core/src/main/res/values/address.xml",
"chars": 29633,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"city_prefixes\">\n <item>North</item>\n "
},
{
"path": "faker-core/src/main/res/values/internet.xml",
"chars": 7403,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"domain_suffixes\">\n <item>ac</item>\n "
},
{
"path": "faker-core/src/main/res/values/lorem.xml",
"chars": 7035,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"lorem_words\">\n <item>alias</item>\n "
},
{
"path": "faker-core/src/main/res/values/names.xml",
"chars": 101266,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string-array name=\"first_names\">\n <item>Aaliyah</item>\n "
},
{
"path": "faker-core/src/main/res/values/phones.xml",
"chars": 191,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string name=\"area_code_phone_mask\">(###) ###-####</string>\n <"
},
{
"path": "faker-core/src/main/res/values/strings.xml",
"chars": 68,
"preview": "<resources>\n <string name=\"app_name\">Faker</string>\n</resources>\n"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 231,
"preview": "#Tue Sep 05 15:21:03 CEST 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER"
},
{
"path": "gradle.properties",
"chars": 0,
"preview": ""
},
{
"path": "gradlew",
"chars": 4971,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "gradlew.bat",
"chars": 2404,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
},
{
"path": "maven_push.gradle",
"chars": 2748,
"preview": "apply plugin: 'maven'\napply plugin: 'signing'\n\ndef sonatypeRepositoryUrl\nif (isReleaseBuild()) {\n println 'RELEASE BU"
},
{
"path": "settings.gradle",
"chars": 30,
"preview": "include ':app', ':faker-core'\n"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the thiagokimo/Faker GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 108 files (323.8 KB), approximately 89.5k tokens, and a symbol index with 554 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.