Skip to content

Commit

Permalink
Everything upto Wednesday
Browse files Browse the repository at this point in the history
  • Loading branch information
SisayKelkle committed Feb 13, 2019
1 parent 93cc4bf commit 99bc0f2
Show file tree
Hide file tree
Showing 173 changed files with 8,767 additions and 1,836 deletions.
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#C0D52F</color>
<color name="yenepay_green">#C0D52F</color>
<color name="transparent">#00c0d52f</color>
</resources>
4 changes: 3 additions & 1 deletion checkoutcounter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ android {
vectorDrawables {
useSupportLibrary true
}
vectorDrawables.useSupportLibrary = true
packagingOptions {
exclude "META-INF/DEPENDENCIES.txt"
exclude "META-INF/DEPENDENCIES"
Expand Down Expand Up @@ -59,8 +58,11 @@ dependencies {
annotationProcessor "android.arch.lifecycle:compiler:$rootProject.archLifecycleVersion"
implementation 'org.nanohttpd:nanohttpd:2.3.1'
implementation 'org.codehaus.jackson:jackson-mapper-asl:1.9.0'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.0.Final'

implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"

debugImplementation "com.amitshekhar.android:debug-db:1.0.4"
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
androidTestImplementation "android.arch.persistence.room:testing:$rootProject.roomVersion"

Expand Down
69 changes: 53 additions & 16 deletions checkoutcounter/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="examples.mob.yenepay.com.checkoutcounter">

<uses-feature android:name="android.hardware.wifi.direct" />

<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"
android:required="true" />
Expand All @@ -14,10 +16,13 @@
<uses-permission
android:name="android.permission.INTERNET"
android:required="true" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />

<application
android:name=".StoreApp"
Expand All @@ -28,24 +33,18 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".CheckoutActivity"
android:name=".ui.checkout.CheckoutActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
android:theme="@style/AppTheme.NoActionBar"
android:parentActivityName=".MainActivity" />
<activity
android:name=".ItemDetailActivity"
android:name=".ui.item.ItemDetailActivity"
android:label="@string/title_item_detail"
android:parentActivityName=".CheckoutActivity"
android:theme="@style/AppTheme.NoActionBar">
android:parentActivityName=".ui.checkout.CheckoutActivity"
android:theme="@style/AppTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="examples.mob.yenepay.com.checkoutcounter.CheckoutActivity" />
android:value="examples.mob.yenepay.com.checkoutcounter.ui.checkout.CheckoutActivity" />
</activity>

<provider
Expand All @@ -70,6 +69,7 @@
android:enabled="true"
android:exported="false" />

<!--
<activity
android:name=".WiFiDirectActivity"
android:label="@string/title_activity_wi_fi_direct">
Expand All @@ -88,16 +88,53 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
-->
<activity
android:name=".SettingsActivity"
android:label="@string/title_activity_settings" />
<activity
android:name=".ManageItemsActivity"
android:name=".ui.item.ManageItemsActivity"
android:label="@string/title_activity_manage_items"
android:parentActivityName=".CheckoutActivity">
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="examples.mob.yenepay.com.checkoutcounter.ui.checkout.CheckoutActivity" />
</activity>
<activity
android:name=".ui.category.ManageCategoriesActivity"
android:label="@string/title_activity_manage_categories"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="examples.mob.yenepay.com.checkoutcounter.CheckoutActivity" />
android:value="examples.mob.yenepay.com.checkoutcounter.ui.checkout.CheckoutActivity" />
</activity>
<activity
android:name=".ui.orders.ManageOrdersActivity"
android:label="@string/title_activity_manage_orders"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="examples.mob.yenepay.com.checkoutcounter.ui.checkout.CheckoutActivity" />
</activity>
<activity
android:name=".ScrollingActivity"
android:label="@string/title_activity_scrolling" />
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".HomeActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme">

</activity>
</application>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* 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.
*/

package examples.mob.yenepay.com.checkoutcounter;

import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

/**
* Global executor pools for the whole application.
* <p>
* Grouping tasks like this avoids the effects of task starvation (e.g. disk reads don't wait behind
* webservice requests).
*/
public class AppExecutors {

private final Executor mDiskIO;

private final Executor mNetworkIO;

private final Executor mMainThread;

private AppExecutors(Executor diskIO, Executor networkIO, Executor mainThread) {
this.mDiskIO = diskIO;
this.mNetworkIO = networkIO;
this.mMainThread = mainThread;
}

public AppExecutors() {
this(Executors.newSingleThreadExecutor(), Executors.newFixedThreadPool(3),
new MainThreadExecutor());
}

public Executor diskIO() {
return mDiskIO;
}

public Executor networkIO() {
return mNetworkIO;
}

public Executor mainThread() {
return mMainThread;
}

private static class MainThreadExecutor implements Executor {
private Handler mainThreadHandler = new Handler(Looper.getMainLooper());

@Override
public void execute(@NonNull Runnable command) {
mainThreadHandler.post(command);
}
}
}
Loading

0 comments on commit 99bc0f2

Please sign in to comment.