Guest User

אדם התותח3

a guest
Jan 9th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 27.37 KB | None | 0 0
  1. main
  2. ======
  3. package whatsapp.com.example.android.julian.newapp;
  4.  
  5. import android.content.Context;
  6. import android.content.Intent;
  7. import android.os.Bundle;
  8. import android.os.PersistableBundle;
  9. import android.support.v7.app.AppCompatActivity;
  10. import android.view.View;
  11. import android.widget.Button;
  12. import android.widget.EditText;
  13. import android.widget.TextView;
  14. import android.widget.Toast;
  15.  
  16. import com.backendless.Backendless;
  17. import com.backendless.BackendlessUser;
  18. import com.backendless.async.callback.AsyncCallback;
  19. import com.backendless.exceptions.BackendlessFault;
  20.  
  21. /**
  22.  * Created by android on 09/01/2017.
  23.  */
  24.  
  25. public class MainActivity extends AppCompatActivity {
  26.     Button btnLogin, btnRegister;
  27.     EditText txtName, txtPass;
  28.     TextView ttlLogo;
  29.     Context context;
  30.     protected void onCreate(Bundle savedInstanceState) {
  31.         super.onCreate(savedInstanceState);
  32.  
  33.         setContentView(R.layout.activity_main);
  34.         setPointer2();
  35.         Backendless.initApp(this,
  36.                 getResources().getString(R.string.app_id),
  37.                 getResources().getString(R.string.android_id),
  38.                 getResources().getString(R.string.app_v));
  39.  
  40.     }
  41.  
  42.     private void setPointer2()
  43.  
  44.     {
  45.         this.context=this;
  46.         btnLogin = (Button) findViewById(R.id.btnLogin);
  47.         btnRegister = (Button) findViewById(R.id.btnRegister);
  48.         txtName = (EditText) findViewById(R.id.txtUserName);
  49.         txtPass = (EditText) findViewById(R.id.txtUserPassword);
  50.         btnLogin.setOnClickListener(new View.OnClickListener() {
  51.             @Override
  52.             public void onClick(View view) {
  53.                 String uName, uPass;
  54.                 uName = txtName.getText().toString();
  55.                 uPass = txtPass.getText().toString();
  56.                 if (uName.length() < 1 || uPass.length() < 1) {
  57.                     Toast.makeText(context, "you must provide user and password", Toast.LENGTH_SHORT).show();
  58.                     return;
  59.                 }
  60.  
  61.                 Backendless.UserService.login(uName, uPass, new AsyncCallback<BackendlessUser>() {
  62.                     @Override
  63.                     public void handleResponse(BackendlessUser response) {
  64.                         startActivity(new Intent(context, MainActivity2.class));
  65.                     }
  66.  
  67.                     @Override
  68.                     public void handleFault(BackendlessFault fault) {
  69.                         Toast.makeText(context, "Error:" + fault.getMessage(), Toast.LENGTH_SHORT).show();
  70.                     }
  71.                 });
  72.             }
  73.         });
  74.  
  75.         btnRegister.setOnClickListener(new View.OnClickListener() {
  76.             @Override
  77.             public void onClick(View view) {
  78.                 startActivity(new Intent(context, Register.class));
  79.             }
  80.         });
  81.  
  82.     }
  83. }
  84.  
  85. =======
  86. main2
  87. ======
  88. package whatsapp.com.example.android.julian.newapp;
  89.  
  90. import android.Manifest;
  91. import android.app.ProgressDialog;
  92. import android.content.ContentResolver;
  93. import android.content.Context;
  94. import android.content.DialogInterface;
  95. import android.content.Intent;
  96. import android.content.pm.PackageManager;
  97. import android.database.Cursor;
  98. import android.provider.ContactsContract;
  99. import android.support.design.widget.FloatingActionButton;
  100. import android.support.v4.app.ActivityCompat;
  101. import android.support.v4.content.ContextCompat;
  102. import android.support.v7.app.AlertDialog;
  103. import android.support.v7.app.AppCompatActivity;
  104. import android.os.Bundle;
  105. import android.util.Log;
  106. import android.view.View;
  107. import android.widget.AdapterView;
  108. import android.widget.ArrayAdapter;
  109. import android.widget.Button;
  110. import android.widget.EditText;
  111. import android.widget.ListAdapter;
  112. import android.widget.ListView;
  113. import android.widget.TextView;
  114. import android.widget.Toast;
  115.  
  116. import com.backendless.Backendless;
  117. import com.backendless.BackendlessUser;
  118. import com.backendless.async.callback.AsyncCallback;
  119. import com.backendless.exceptions.BackendlessFault;
  120.  
  121. import java.util.ArrayList;
  122. import java.util.Collections;
  123.  
  124. public class MainActivity2 extends AppCompatActivity {
  125.     private static String TAG = "Permissions";
  126.     private static final int CONTACTS_REQUEST_CODE = 101;
  127.  
  128.     Context context;
  129.     ListView list;
  130.     ArrayList<String> phoneContactList;
  131.     FloatingActionButton fab;
  132.     Adapter myAdapter;
  133.  
  134.     @Override
  135.     protected void onCreate(Bundle savedInstanceState) {
  136.         super.onCreate(savedInstanceState);
  137.         setContentView(R.layout.contacts);
  138.         requestPermissions();
  139.         setPointer();
  140.  
  141.     }
  142.  
  143.     private void makeRequest() {
  144.         ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS}, CONTACTS_REQUEST_CODE);
  145.     }
  146.  
  147.     @Override
  148.     public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
  149.  
  150.         switch (requestCode) {
  151.  
  152.             case CONTACTS_REQUEST_CODE:
  153.                 if (grantResults.length > 0 || grantResults[0] == PackageManager.PERMISSION_GRANTED) {
  154.                     Log.i(TAG, "onRequestPermissionsResult: Permission Granted");
  155.                 } else {
  156.                     Log.i(TAG, "onRequestPermissionsResult: Permission Denied");
  157.                 }
  158.                 return;
  159.         }
  160.     }
  161.  
  162.     private void requestPermissions() {
  163.         int permission = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_CONTACTS);
  164.         if (permission != PackageManager.PERMISSION_GRANTED) {
  165.  
  166.             Log.i(TAG, "onCreate: Permission to record denied");
  167.             {
  168.                 if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_CONTACTS)) {
  169.  
  170.                     AlertDialog.Builder builder = new AlertDialog.Builder(this);
  171.                     builder.setMessage("Permission to access the CONTACTS is required for this app.")
  172.                             .setTitle("Permission required");
  173.                     builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
  174.                         @Override
  175.                         public void onClick(DialogInterface dialogInterface, int i) {
  176.                             Log.i(TAG, "onClick: Clicked");
  177.  
  178.                             makeRequest();
  179.  
  180.                         }
  181.                     });
  182.  
  183.                     AlertDialog dialog = builder.create();
  184.                     dialog.show();
  185.                 } else {
  186.  
  187.                     makeRequest();
  188.                 }
  189.             }
  190.         }
  191.     }
  192.  
  193.     private void setPointer() {
  194.  
  195.         this.context = this;
  196.  
  197.         fab = (FloatingActionButton) findViewById(R.id.fab);
  198.         fab.setOnClickListener(new View.OnClickListener() {
  199.             @Override
  200.             public void onClick(View view) {
  201.                 final EditText myTxt = new EditText(context);
  202.                 myTxt.setHint("הכנס שם");
  203.                 new AlertDialog.Builder(context)
  204.                         .setTitle("הכנס את פרטי המוזמן")
  205.  
  206.                         .setPositiveButton("OK",
  207.                                 new DialogInterface.OnClickListener() {
  208.                                     public void onClick(DialogInterface dialog, int which) {
  209.  
  210.                                         myAdapter.addFriend(myTxt.getText().toString());
  211.                                         dialog.dismiss();
  212.  
  213.                                     }
  214.                                 })
  215.                         .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
  216.                             public void onClick(DialogInterface dialog, int which) {
  217.  
  218.                                 dialog.dismiss();
  219.                             }
  220.                         })
  221.                         .setIcon(android.R.drawable.ic_dialog_alert)
  222.                         .setView(myTxt)
  223.                         .show();
  224.             }
  225.  
  226.  
  227.         });
  228.  
  229.         ProgressDialog pd = new ProgressDialog(context);
  230.         pd.setMessage("טוען אנשי קשר....");
  231.         pd.show();
  232.  
  233.         phoneContactList = new ArrayList<>();
  234.         list = (ListView) findViewById(R.id.list);
  235.         ContentResolver cr = getContentResolver();
  236.         Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
  237.  
  238.         if (cur.getCount() > 0) {
  239.  
  240.             while (cur.moveToNext()) {
  241.                 String id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID));
  242.                 String name = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
  243.                 if (Integer.parseInt(cur.getString(cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) > 0) {
  244.                     Cursor pCur = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ?", new String[]{id}, null);
  245.                     while (pCur.moveToNext()) {
  246.                         phoneContactList.add(name);
  247.                         Log.i("Contact List", name);
  248.                     }
  249.                     pCur.close();
  250.                 }
  251.             }
  252.  
  253.             Collections.sort(phoneContactList);
  254.             int cnt = phoneContactList.size();
  255.  
  256.             myAdapter = new Adapter(context, phoneContactList);
  257.             list.setAdapter(myAdapter);
  258.             pd.dismiss();
  259.         }
  260.         cur.close();
  261.  
  262.     }
  263.  
  264.  
  265. }
  266. =====
  267. adapter
  268. =====
  269. package whatsapp.com.example.android.julian.newapp;
  270.  
  271. import android.app.AlertDialog;
  272. import android.content.ContentResolver;
  273. import android.content.Context;
  274. import android.content.DialogInterface;
  275. import android.content.SharedPreferences;
  276. import android.database.Cursor;
  277. import android.provider.ContactsContract;
  278. import android.util.Log;
  279. import android.view.LayoutInflater;
  280. import android.view.View;
  281. import android.view.ViewGroup;
  282. import android.widget.ArrayAdapter;
  283. import android.widget.BaseAdapter;
  284. import android.widget.CheckBox;
  285. import android.widget.ListView;
  286. import android.widget.Switch;
  287. import android.widget.TextView;
  288.  
  289. import java.util.ArrayList;
  290. import java.util.Collections;
  291. import java.util.List;
  292.  
  293. /**
  294.  * Created by android on 02/01/2017.
  295.  */
  296.  
  297. public class Adapter extends BaseAdapter {
  298.  
  299.  
  300.     Context context;
  301.     List<String> phoneContactList;
  302.  
  303.     public Adapter(Context context, List<String> friendsList) {
  304.         this.context = context;
  305.         this.phoneContactList = friendsList;
  306.     }
  307.  
  308.     @Override
  309.     public int getCount() {
  310.         return phoneContactList.size();
  311.     }
  312.  
  313.     @Override
  314.     public Object getItem(int i) {
  315.  
  316.         return phoneContactList.get(i);
  317.     }
  318.  
  319.     @Override
  320.     public long getItemId(int i) {
  321.         return i;
  322.     }
  323.  
  324.     @Override
  325.     public View getView(int i, View view, ViewGroup viewGroup) {
  326.  
  327.  
  328.         View myInflatedView = LayoutInflater.from(context).inflate(R.layout.friend_item, null, false);
  329.         TextView txtName = (TextView) myInflatedView.findViewById(R.id.txtName);
  330.         final CheckBox mySwitch = (CheckBox) myInflatedView.findViewById(R.id.mySwitch);
  331.  
  332.         txtName.setText(phoneContactList.get(i));
  333.  
  334.        mySwitch.setOnClickListener(new View.OnClickListener() {
  335.             @Override
  336.             public void onClick(View view) {
  337.                 android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(context);
  338.                 builder.setMessage("Permission to access the CONTACTS is required for this app.")
  339.                         .setTitle("Permission required");
  340.                 builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
  341.                     //public static final String TAG = ;
  342.  
  343.                     @Override
  344.                     public void onClick(DialogInterface dialogInterface, int i) {
  345.                        // Log.i(TAG, "onClick: Clicked");
  346.  
  347.                         //makeRequest();
  348.  
  349.                     }
  350.                 });
  351.  
  352.                 android.support.v7.app.AlertDialog dialog = builder.create();
  353.                 dialog.show();
  354.                 mySwitch.setChecked(!mySwitch.isChecked());
  355.  
  356.             }
  357.         });
  358.         return myInflatedView;
  359.     }
  360.  
  361.     public void addFriend(String friendName)
  362.     {
  363.         phoneContactList.add(friendName);
  364.         notifyDataSetChanged();
  365.  
  366.     }
  367. }
  368.  
  369. =========
  370. register
  371. ======
  372. package whatsapp.com.example.android.julian.newapp;
  373.  
  374. import android.content.Context;
  375. import android.os.Bundle;
  376. import android.support.v7.app.AppCompatActivity;
  377. import android.view.View;
  378. import android.widget.Button;
  379. import android.widget.EditText;
  380. import android.widget.TextView;
  381. import android.widget.Toast;
  382.  
  383. import com.backendless.Backendless;
  384. import com.backendless.BackendlessUser;
  385. import com.backendless.async.callback.AsyncCallback;
  386. import com.backendless.exceptions.BackendlessFault;
  387.  
  388. public class Register extends AppCompatActivity {
  389.     Button btnRegister, btnCancel;
  390.     EditText txtUname, txtUpass, txtUpass2, uEmail, uPhone;
  391.     TextView txtView;
  392.     Context context;
  393.  
  394.     @Override
  395.     protected void onCreate(Bundle savedInstanceState) {
  396.         super.onCreate(savedInstanceState);
  397.         setContentView(R.layout.activity_register);
  398.         setPointer();
  399.     }
  400.  
  401.     private void setPointer() {
  402.  
  403.         this.context = this;
  404.         uPhone = (EditText) findViewById(R.id.txtPhone);
  405.         btnCancel = (Button) findViewById(R.id.btnCancel);
  406.         btnRegister = (Button) findViewById(R.id.btnRegisterUser);
  407.         txtUname = (EditText) findViewById(R.id.txtUserName);
  408.         txtUpass = (EditText) findViewById(R.id.txtPassword2);
  409.         txtUpass2 = (EditText) findViewById(R.id.txtPassword3);
  410.         uEmail = (EditText) findViewById(R.id.txtEmail);
  411.         txtView = (TextView) findViewById(R.id.txtView);
  412.  
  413.         btnCancel.setOnClickListener(new View.OnClickListener() {
  414.             @Override
  415.             public void onClick(View view) {
  416.                 finish();
  417.             }
  418.         });
  419.         btnRegister.setOnClickListener(new View.OnClickListener() {
  420.             @Override
  421.             public void onClick(View view) {
  422.                 if (checkData()) {
  423.                     BackendlessUser newUser = new BackendlessUser();
  424.                     newUser.setEmail(uEmail.getText().toString());
  425.                     newUser.setPassword(txtUpass.getText().toString());
  426.                     newUser.setProperty("phone_number",uPhone.getText().toString());
  427.                 newUser.setProperty("user_name",txtUname.getText().toString());
  428.                     Backendless.UserService.register(newUser, new AsyncCallback<BackendlessUser>() {
  429.                         @Override
  430.                         public void handleResponse(BackendlessUser response) {
  431.                             Toast.makeText(context, "User Registred...", Toast.LENGTH_SHORT).show();
  432.                             finish();
  433.                         }
  434.  
  435.                         @Override
  436.                         public void handleFault(BackendlessFault fault) {
  437.                             Toast.makeText(context, "Error" + fault.getMessage(), Toast.LENGTH_SHORT).show();
  438.                         }
  439.                     });
  440.                 }
  441.             }
  442.         });
  443.     }
  444.  
  445.     private boolean checkData() {
  446.         //if user update fields
  447.         if (txtUname.getText().toString().length() < 1 ||
  448.                 txtUpass2.getText().toString().length() < 1 ||
  449.                 txtUpass.getText().toString().length() < 1)
  450.  
  451.         {
  452.             return false;
  453.         }
  454.  
  455.         //if password are equals
  456.         if (!txtUpass.getText().toString().equals(txtUpass2.getText().toString())) {
  457.             Toast.makeText(context, "Password not match..", Toast.LENGTH_SHORT).show();
  458.             return false;
  459.         }
  460.  
  461.         return true;
  462.     }
  463.  
  464. }
  465. ======
  466. manifest
  467. =====
  468. <?xml version="1.0" encoding="utf-8"?>
  469. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  470. package="whatsapp.com.example.android.julian.newapp">
  471.  
  472. <uses-permission android:name="android.permission.READ_CONTACTS" />
  473. <uses-permission android:name="android.permission.WRITE_CONTACTS" />
  474.     <uses-permission android:name="android.permission.INTERNET"/>
  475.     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  476.  
  477. <application
  478.     android:allowBackup="true"
  479.     android:icon="@mipmap/ic_launcher"
  480.     android:label="@string/app_name"
  481.     android:supportsRtl="true"
  482.     android:theme="@style/AppTheme">
  483.     <activity android:name=".MainActivity">
  484.         <intent-filter>
  485.             <action android:name="android.intent.action.MAIN" />
  486.  
  487.             <category android:name="android.intent.category.LAUNCHER" />
  488.         </intent-filter>
  489.     </activity>
  490.     <activity android:name=".Register"/>
  491.     <activity android:name=".MainActivity2"/>
  492. </application>
  493.  
  494. </manifest>
  495. ======
  496. main.xml
  497. ====
  498. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  499.     android:layout_width="match_parent"
  500.     android:layout_height="match_parent"
  501.     android:layoutDirection="rtl"
  502.     android:orientation="vertical"
  503.     android:textDirection="rtl"
  504.     android:weightSum="1">
  505.  
  506.     <LinearLayout
  507.         android:layout_width="match_parent"
  508.         android:layout_height="150dp"
  509.         android:orientation="vertical">
  510.  
  511.         <TextView
  512.             android:layout_width="match_parent"
  513.             android:layout_height="170dp"
  514.             android:text="Login"
  515.             android:gravity="center"
  516.             android:textSize="100sp">
  517.  
  518.         </TextView>
  519.     </LinearLayout>
  520.  
  521.     <LinearLayout
  522.         android:layout_width="match_parent"
  523.         android:layout_height="100dp"
  524.         android:orientation="vertical">
  525.  
  526.         <EditText
  527.             android:id="@+id/txtUserName"
  528.             android:layout_width="match_parent"
  529.             android:layout_height="wrap_content"
  530.             android:hint="@string/enter_user_name"
  531.             android:inputType="text"
  532.             android:textSize="22sp" />
  533.  
  534.         <EditText
  535.             android:id="@+id/txtUserPassword"
  536.             android:layout_width="match_parent"
  537.             android:layout_height="wrap_content"
  538.             android:hint="@string/enter_password"
  539.  
  540.             android:textSize="22sp" />
  541.     </LinearLayout>
  542.  
  543.     <LinearLayout
  544.         android:layout_width="match_parent"
  545.         android:layout_height="150dp"
  546.         android:orientation="vertical"
  547.         android:layout_weight="0.53">
  548.  
  549.         <Button
  550.             android:id="@+id/btnLogin"
  551.             android:layout_width="match_parent"
  552.             android:layout_height="wrap_content"
  553.             android:layout_marginBottom="20dp"
  554.             android:background="#00BFFF"
  555.             android:text="@string/btn_login"
  556.             android:textColor="#ffffff"
  557.             android:textSize="32sp" />
  558.  
  559.         <Button
  560.             android:id="@+id/btnRegister"
  561.             android:layout_width="match_parent"
  562.             android:layout_height="wrap_content"
  563.             android:layout_marginTop="50dp"
  564.             android:background="#00BFFF"
  565.             android:text="@string/Register_button"
  566.             android:textColor="#ffffff"
  567.             android:textSize="32sp" />
  568.     </LinearLayout>
  569. </LinearLayout>
  570. ======
  571. register.xml
  572. =======
  573. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  574.     android:layout_width="match_parent"
  575.     android:layout_height="match_parent"
  576.     android:orientation="vertical">
  577.  
  578.     <RelativeLayout
  579.         android:layout_width="match_parent"
  580.         android:layout_height="match_parent"
  581.         android:layoutDirection="rtl"
  582.         android:textDirection="rtl">
  583.  
  584.         <EditText
  585.             android:id="@+id/txtUserName"
  586.             android:layout_width="match_parent"
  587.             android:layout_height="wrap_content"
  588.             android:hint="@string/enter_user_name"
  589.  
  590.             />
  591.  
  592.         <EditText
  593.             android:id="@+id/txtEmail"
  594.             android:layout_width="match_parent"
  595.             android:layout_height="wrap_content"
  596.             android:layout_below="@id/txtUserName"
  597.             android:hint="@string/enter_email" />
  598.  
  599.         <EditText
  600.             android:id="@+id/txtPhone"
  601.             android:layout_width="match_parent"
  602.             android:layout_height="wrap_content"
  603.             android:layout_below="@id/txtEmail"
  604.             android:hint="@string/enter_your_phone_number" />
  605.  
  606.         <EditText
  607.             android:id="@+id/txtPassword2"
  608.             android:layout_width="match_parent"
  609.             android:layout_height="wrap_content"
  610.             android:layout_below="@id/txtPhone"
  611.             android:hint="@string/enter_password" />
  612.  
  613.         <EditText
  614.             android:id="@+id/txtPassword3"
  615.             android:layout_width="match_parent"
  616.             android:layout_height="wrap_content"
  617.             android:layout_below="@id/txtPassword2"
  618.             android:hint="@string/confirm_password" />
  619.  
  620.         <CheckBox
  621.             android:id="@+id/checkbox"
  622.             android:layout_width="wrap_content"
  623.             android:layout_height="wrap_content"
  624.             android:layout_below="@+id/btnRegisterUser"
  625.             android:layout_marginTop="10sp"
  626.             android:text="אני מסכים" />
  627.  
  628.         <TextView
  629.             android:id="@+id/txtView"
  630.             android:layout_width="wrap_content"
  631.             android:layout_height="wrap_content"
  632.             android:layout_below="@+id/btnCancel"
  633.             android:textColor="@color/colorPrimary"
  634.             android:layout_marginRight="10sp"
  635.             android:text="תנאי השימוש"
  636.             android:textSize="15sp"
  637.  
  638.  
  639.             />
  640.  
  641.         <Button
  642.             android:id="@+id/btnRegisterUser"
  643.             android:layout_width="150dp"
  644.             android:layout_height="wrap_content"
  645.             android:layout_below="@id/txtPassword3"
  646.             android:layout_marginTop="35dp"
  647.             android:text="@string/Register_button" />
  648.  
  649.         <Button
  650.             android:id="@+id/btnCancel"
  651.             android:layout_width="150dp"
  652.             android:layout_height="wrap_content"
  653.             android:layout_below="@id/txtPassword3"
  654.             android:layout_marginTop="35dp"
  655.             android:layout_toEndOf="@id/btnRegisterUser"
  656.             android:text="@string/btn_cancel" />
  657.  
  658.  
  659.     </RelativeLayout>
  660.  
  661.     <TextView
  662.         android:layout_width="match_parent"
  663.         android:layout_height="wrap_content"
  664.         android:layout_marginTop="20dp"
  665.         android:gravity="center"
  666.         android:text="הרשמה"
  667.         android:textSize="32sp" />
  668.  
  669. </LinearLayout>
  670. =====
  671. contacts.xml
  672. ====
  673. <android.support.design.widget.CoordinatorLayout
  674.     xmlns:android="http://schemas.android.com/apk/res/android"
  675.     xmlns:tools="http://schemas.android.com/tools"
  676.     android:layout_width="match_parent"
  677.     android:layout_height="match_parent"
  678.     android:fitsSystemWindows="true">
  679.  
  680.  
  681.     <android.support.design.widget.FloatingActionButton
  682.         android:id="@+id/fab"
  683.         android:layout_width="wrap_content"
  684.         android:layout_height="wrap_content"
  685.         android:layout_gravity="end|bottom"
  686.         android:layout_margin="@dimen/fab_margin"
  687.         android:src="@drawable/fab_plus_icon" />
  688.  
  689.     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  690.         android:layout_width="match_parent"
  691.         android:layout_height="match_parent"
  692.         android:orientation="vertical">
  693.  
  694.         <TextView
  695.             android:layout_width="match_parent"
  696.             android:layout_height="wrap_content"
  697.             android:elevation="20dp"
  698.             android:gravity="center"
  699.             android:text="contacts"
  700.             android:textSize="40sp" />
  701.  
  702.         <LinearLayout
  703.             android:layout_width="match_parent"
  704.             android:layout_height="3sp"
  705.             android:background="@color/colorPrimary" />
  706.  
  707.         <ListView
  708.             android:id="@+id/list"
  709.             android:layout_width="match_parent"
  710.             android:layout_height="match_parent"></ListView>
  711.     </LinearLayout>
  712. </android.support.design.widget.CoordinatorLayout>
  713. ========
  714. item_friend.xml
  715. =======
  716. <?xml version="1.0" encoding="utf-8"?>
  717. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  718.     android:orientation="horizontal" android:layout_width="match_parent"
  719.     android:layout_height="wrap_content"
  720.     android:layoutDirection="rtl"
  721.     android:layout_margin="10dp">
  722.     <CheckBox
  723.         android:layout_width="wrap_content"
  724.         android:layout_height="wrap_content"
  725.         android:id="@+id/mySwitch"
  726.         android:layout_gravity="center_vertical"/>
  727.     <TextView
  728.         android:layout_width="match_parent"
  729.         android:layout_height="wrap_content"
  730.         android:text="SAMPLE TEXT"
  731.         android:id="@+id/txtName"
  732.         android:textSize="30sp"/>
  733. </LinearLayout>
  734. =======
  735. string.res
  736. =====
  737. <resources>
  738.  
  739.     <string name="button_text">asd</string>
  740.  
  741.         <string name="app_name">Cordinator</string>
  742.         <string name="enter_user_name">הכנס/י שם משתמש....</string>
  743.         <string name="enter_email">הכנס/י דואר אלקטרוני...</string>
  744.         <string name="enter_your_phone_number">הכנס/י מספר נייד....</string>
  745.         <string name="enter_password">הכנס/י סיסמא...</string>
  746.         <string name="confirm_password">אשר/י סיסמא..</string>
  747.         <string name="title_activity_register">Register</string>
  748.         <string name="Register_button">הרשמה</string>
  749.         <string name="btn_cancel">ביטול</string>
  750.         <string name="btn_login">כניסה</string>
  751.     <string name="app_id">66A2E76C-4E40-6695-FFCF-CD56DC334D00
  752. </string>
  753.         <string name="app_v">v1</string>
  754.     <string name="android_id">F554F240-A498-DC21-FFEC-792D1D8D1C00
  755. </string>
  756.  
  757.  
  758. </resources>
  759.  
  760. =======
  761. grable
  762. =====
  763. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  764.  
  765. buildscript {
  766.     repositories {
  767.         jcenter()
  768.     }
  769.     dependencies {
  770.         classpath 'com.android.tools.build:gradle:2.2.2'
  771.         classpath 'com.android.tools.build:gradle:2.2.2'
  772.         // NOTE: Do not place your application dependencies here; they belong
  773.         // in the individual module build.gradle files
  774.     }
  775. }
  776.  
  777. allprojects {
  778.     repositories {
  779.         jcenter()
  780.     }
  781. }
  782.  
  783. task clean(type: Delete) {
  784.     delete rootProject.buildDir
  785. }
  786. ======
  787. grable2
  788. ======
  789. apply plugin: 'com.android.application'
  790.  
  791. android {
  792.     compileSdkVersion 25
  793.     buildToolsVersion "25.0.1"
  794.     defaultConfig {
  795.         applicationId "whatsapp.com.example.android.julian.newapp"
  796.         minSdkVersion 19
  797.         targetSdkVersion 25
  798.         versionCode 1
  799.         versionName "1.0"
  800.         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  801.     }
  802.     buildTypes {
  803.         release {
  804.             minifyEnabled false
  805.             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  806.         }
  807.     }
  808. }
  809.  
  810. dependencies {
  811.     compile fileTree(include: ['*.jar'], dir: 'libs')
  812.     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  813.         exclude group: 'com.android.support', module: 'support-annotations'
  814.     })
  815.     compile 'com.android.support:appcompat-v7:25.1.0'
  816.     testCompile 'junit:junit:4.12'
  817.     compile 'com.scalified:fab:1.1.2'
  818.     compile 'com.backendless:backendless:3.0.20.1'
  819.     compile 'com.android.support:design:25.1.0'
  820. }
Add Comment
Please, Sign In to add comment