Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
Remove custom binary for consistency, missing translations
Browse files Browse the repository at this point in the history
  • Loading branch information
velitasali committed Feb 23, 2018
1 parent 2079ea8 commit 154c0d4
Show file tree
Hide file tree
Showing 104 changed files with 116 additions and 7,879 deletions.
7 changes: 3 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ dependencies {
testImplementation 'junit:junit:4.12'

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(path: ':gdatabase')
implementation project(path: ':qrcode')
implementation project(path: ':updatewithgithub')
implementation project(':gdatabase')
implementation project(':updatewithgithub')

implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'

implementation 'com.journeyapps:zxing-android-embedded:3.5.0'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.google.zxing:core:3.3.0'
}
8 changes: 5 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@
</activity>

<activity
android:name="com.journeyapps.barcodescanner.CaptureActivity"
android:screenOrientation="fullSensor"
tools:replace="screenOrientation" />
android:name=".activity.QRScannerActivity"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@style/AppTheme.QRScannerTheme"
android:windowSoftInputMode="stateAlwaysHidden"/>

<activity
android:name=".activity.FilePickerActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package com.genonbeta.TrebleShot.activity;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;

import com.journeyapps.barcodescanner.CaptureManager;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;

/**
* created by: Veli
* date: 23.02.2018 19:50
*/

public class QRScannerActivity extends AppCompatActivity
{
private CaptureManager mManager;
private DecoratedBarcodeView mScannerView;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);

mScannerView = initializeContent();

mManager = new CaptureManager(this, mScannerView);
mManager.initializeFromIntent(getIntent(), savedInstanceState);
mManager.decode();
}

protected DecoratedBarcodeView initializeContent()
{
setContentView(com.google.zxing.client.android.R.layout.zxing_capture);
return (DecoratedBarcodeView) findViewById(com.google.zxing.client.android.R.id.zxing_barcode_scanner);
}

@Override
protected void onResume()
{
super.onResume();
mManager.onResume();
}

@Override
protected void onPause()
{
super.onPause();
mManager.onPause();
}

@Override
protected void onDestroy()
{
super.onDestroy();
mManager.onDestroy();
}

@Override
protected void onSaveInstanceState(Bundle outState)
{
super.onSaveInstanceState(outState);
mManager.onSaveInstanceState(outState);
}

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults)
{
mManager.onRequestPermissionsResult(requestCode, permissions, grantResults);
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
return mScannerView.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.TabHost;
import android.widget.Toast;

import com.genonbeta.CoolSocket.CoolSocket;
Expand Down Expand Up @@ -681,6 +680,7 @@ private void requestQRScan()
mQRScanRequested = false;

IntentIntegrator integrator = new IntentIntegrator(this)
.setCaptureActivity(QRScannerActivity.class)
.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES)
.setPrompt(getString(R.string.text_scanQRCodeHelp))
.setOrientationLocked(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
inflater.inflate(R.menu.actions_search, menu);

SearchView searchView = ((SearchView) menu.findItem(R.id.search)
.getActionView());
.getActionView()
);

searchView.setOnQueryTextListener(mSearchComposer);
searchView.setMaxWidth(500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ public static int getAllowedKeyManagement(WifiConfiguration wifiConfiguration)

try {
return Integer.valueOf(keyManagement.substring(1, keyManagement.length() - 1));
} catch (Exception e) {}
} catch (Exception e) {
}

return -1;
}
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/layout/activity_qrscanner.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<com.journeyapps.barcodescanner.DecoratedBarcodeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/zxing_barcode_scanner"
app:zxing_preview_scaling_strategy="centerCrop"
app:zxing_use_texture_view="false"/>

</merge>
2 changes: 1 addition & 1 deletion app/src/main/res/menu/actions_activity_share.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:id="@+id/actions_activity_share_scan_barcode"
android:icon="@drawable/ic_qrcode_scan_white_24dp"
android:orderInCategory="0"
android:title="Scan QR to send"
android:title="@string/butn_qrScanToSend"
app:showAsAction="always"/>

</menu>
2 changes: 1 addition & 1 deletion app/src/main/res/menu/actions_network_device.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:id="@+id/network_devices_barcode_generate"
android:icon="@drawable/ic_qrcode_white_24dp"
android:orderInCategory="0"
android:title="Receive using QR Code"
android:title="@string/butn_qrToggle"
app:showAsAction="always"/>

<item
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -337,4 +337,6 @@
<string name="text_qrCodeAvailableHelp">Göndericiye bu QR kodunu TrebleShot üzerinde taramasını söyleyin</string>
<string name="text_qrCodeHotspotDisabledHelp">TrebleShot Hotspot\'u başlatın</string>
<string name="text_scanQRCodeHelp">Alıcının ekranı üzerindeki QR kodunu tarayın</string>
<string name="butn_qrScanToSend">Göndermek için QR tara</string>
<string name="butn_qrToggle">QR Kod gösterimi</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,6 @@
<string name="text_qrCodeAvailableHelp">Tell sender to scan this QR code using TrebleShot</string>
<string name="text_qrCodeHotspotDisabledHelp">Start TrebleShot hotspot first</string>
<string name="text_scanQRCodeHelp">Scan the QR code on the receiver\'s screen</string>
<string name="butn_qrScanToSend">Scan QR Code to send</string>
<string name="butn_qrToggle">Toggle QR Code showing</string>
</resources>
5 changes: 5 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
<item name="android:windowBackground">@color/windowBackground</item>
</style>

<style name="AppTheme.QRScannerTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>

<style name="AppTheme.NoActionBar.GreyStatusBar" parent="@style/AppTheme.NoActionBar">
<item name="colorPrimaryDark">#bbb</item>
<item name="colorPrimary">#bbb</item>
Expand Down
1 change: 0 additions & 1 deletion qrcode/.gitignore

This file was deleted.

63 changes: 0 additions & 63 deletions qrcode/build.gradle

This file was deleted.

21 changes: 0 additions & 21 deletions qrcode/proguard-rules.pro

This file was deleted.

This file was deleted.

37 changes: 0 additions & 37 deletions qrcode/src/main/AndroidManifest.xml

This file was deleted.

Loading

0 comments on commit 154c0d4

Please sign in to comment.