owly
Banned
-
- Joined
- Oct 26, 2018
- Posts
- 2,294
gonna write this as tl;dr as possible :
foids want resources, man want sex. as the red and black pills, spread exponentialy faster, women will become starved, homeless, and sick.
my Idea is : foids that want to get along should wear a tattoo barcode on a visible place on their body, when scanned will show the price per time
and sexual services that can be provided.
(open to improvements to this suggestion).
anyway here is the barcode scanner code, (with enough intrest and time maybe I"ll add to it an online DB, data fields and more) :
gragle(module) dependencies :
manifest permissions :
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
res\value\colors.xml :
res\drawable\bg_gradient.xml
activity_main.xml :
MainActivity.java :
notes :
// imported due to conflicts between implementation versions
implementation "com.android.support:animated-vector-drawable:27.1.1"
implementation "com.android.support:support-media-compat:27.1.1"
implementation "com.android.support:support-v4:27.1.1"
copy err at implementation 'com.android.support:appcompat-v7:27.1.1'
search them and paste fix implementations, then :
match ver # of fixes to 27.1.1 (as err causer)
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
is a standart for new apps
unrelated : on example projects DLed from GitHub you can ignore example in the
name classes they are only used for testing
foids want resources, man want sex. as the red and black pills, spread exponentialy faster, women will become starved, homeless, and sick.
my Idea is : foids that want to get along should wear a tattoo barcode on a visible place on their body, when scanned will show the price per time
and sexual services that can be provided.
(open to improvements to this suggestion).
anyway here is the barcode scanner code, (with enough intrest and time maybe I"ll add to it an online DB, data fields and more) :
gragle(module) dependencies :
Code:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
// imported due to conflicts between implementation versions
implementation "com.android.support:animated-vector-drawable:27.1.1"
implementation "com.android.support:support-media-compat:27.1.1"
implementation "com.android.support:support-v4:27.1.1"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
// barcode scanning imports
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
implementation 'com.tapadoo.android:alerter:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
res\value\colors.xml :
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
<color name="colorAccentSecondary">#ad1a7f</color>
</resources>
Code:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135"
android:centerColor="@color/colorAccentSecondary"
android:endColor="@color/colorPrimary"
android:startColor="@color/colorAccent"
android:type="linear" />
<corners android:radius="0dp" />
</shape>
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_gradient"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:orientation="vertical"
android:paddingLeft="40dp"
android:paddingRight="40dp">
<TextView
android:id="@+id/text_view_result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:fontFamily="sans-serif-light"
android:gravity="center_horizontal"
android:text="Scan the QR code to see Result"
android:textColor="@android:color/white"
android:textSize="16sp" />
<Button
android:id="@+id/btn_copy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:fontFamily="sans-serif-medium"
android:foreground="?attr/selectableItemBackground"
android:gravity="center_horizontal"
android:paddingTop="60dp"
android:text="Copy Result"
android:textColor="@android:color/white"
android:textSize="18sp" />
</LinearLayout>
<Button
android:id="@+id/btn_scan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@android:color/transparent"
android:fontFamily="sans-serif-medium"
android:foreground="?attr/selectableItemBackground"
android:paddingBottom="60dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="Scan QR Code"
android:textColor="@android:color/white"
android:textSize="18sp" />
</RelativeLayout>
Code:
package com.yotamarker.barcode9;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.os.Build;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import com.tapadoo.alerter.Alerter;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private static final int REQUEST_ID_MULTIPLE_PERMISSIONS = 1;
private Button copy;
private TextView result;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
copy = findViewById(R.id.btn_copy);
result = findViewById(R.id.text_view_result);
findViewById(R.id.btn_scan).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (checkAndRequestPermissions()) {
new IntentIntegrator(MainActivity.this).initiateScan();
}
}
});
copy.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) MainActivity.this.getSystemService(Context.CLIPBOARD_SERVICE);
android.content.ClipData clip = android.content.ClipData.newPlainText(getString(R.string.app_name), result.getText().toString());
if (clipboard != null) {
clipboard.setPrimaryClip(clip);
Toast.makeText(MainActivity.this, "Copied to clipboard", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(MainActivity.this, "failed to copy result", Toast.LENGTH_SHORT).show();
}
}
});
}
@Override
protected void onStart() {
super.onStart();
if (result.getText().toString().trim().equalsIgnoreCase("Scan the QR code to see Result")) {
copy.setVisibility(View.GONE);
} else {
copy.setVisibility(View.VISIBLE);
}
}
private void transparentToolbar() {
if (Build.VERSION.SDK_INT >= 19 && Build.VERSION.SDK_INT < 21) {
setWindowFlag(this, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, true);
}
if (Build.VERSION.SDK_INT >= 19) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
if (Build.VERSION.SDK_INT >= 21) {
setWindowFlag(this, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, false);
getWindow().setStatusBarColor(Color.TRANSPARENT);
}
}
private void setWindowFlag(Activity activity, final int bits, boolean on) {
Window win = activity.getWindow();
WindowManager.LayoutParams winParams = win.getAttributes();
if (on) {
winParams.flags |= bits;
} else {
winParams.flags &= ~bits;
}
win.setAttributes(winParams);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
//retrieve scan result
IntentResult scanningResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (scanningResult != null) {
//we have a result
String scanContent = scanningResult.getContents();
// process received data
if (scanContent != null && !scanContent.isEmpty()) {
((TextView) findViewById(R.id.text_view_result)).setText(scanningResult.getContents());
} else {
Alerter.create(MainActivity.this)
.setTitle("QR & Barcode Scanner")
.setText("Scan Cancelled")
.setBackgroundColorRes(R.color.colorPrimaryDark)
.show();
}
} else {
Alerter.create(MainActivity.this)
.setTitle("QR & Barcode Scanner")
.setText("No scan data received!")
.setBackgroundColorRes(R.color.colorPrimaryDark)
.show();
}
}
private boolean checkAndRequestPermissions() {
int camera = ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA);
List<String> listPermissionsNeeded = new ArrayList<>();
if (camera != PackageManager.PERMISSION_GRANTED) {
listPermissionsNeeded.add(android.Manifest.permission.CAMERA);
}
if (!listPermissionsNeeded.isEmpty()) {
ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), REQUEST_ID_MULTIPLE_PERMISSIONS);
return false;
}
return true;
}
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
switch (requestCode) {
case REQUEST_ID_MULTIPLE_PERMISSIONS: {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
new IntentIntegrator(MainActivity.this).initiateScan();
}
}
}
}
}
notes :
// imported due to conflicts between implementation versions
implementation "com.android.support:animated-vector-drawable:27.1.1"
implementation "com.android.support:support-media-compat:27.1.1"
implementation "com.android.support:support-v4:27.1.1"
copy err at implementation 'com.android.support:appcompat-v7:27.1.1'
search them and paste fix implementations, then :
match ver # of fixes to 27.1.1 (as err causer)
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
is a standart for new apps
unrelated : on example projects DLed from GitHub you can ignore example in the
name classes they are only used for testing