Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Eyad Hrame
Added: Mar 29, 2021 11:58 AM
Modified: Mar 29, 2021 12:30 PM
Views: 170
Tags: logintotal
  1.  
  2. <root>
  3.    
  4.    
  5.     /*
  6.  * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
  7.  * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  8.  *
  9.  *
  10.  *
  11.  *
  12.  *
  13.  *
  14.  *
  15.  *
  16.  *
  17.  *
  18.  *
  19.  *
  20.  *
  21.  *
  22.  *
  23.  *
  24.  *
  25.  *
  26.  *
  27.  *
  28.  */
  29.  
  30. package com.sun.tools.javac;
  31.  
  32. import java.io.PrintWriter;
  33.  
  34. /**
  35.  * A legacy programmatic interface for the Java Programming Language
  36.  * compiler, javac.
  37.  * See the <a href="{@docRoot}/jdk.compiler/module-summary.html">{@code jdk.compiler}</a>
  38.  * module for details on replacement APIs.
  39.  */
  40. public class Main {
  41.     /**
  42.      * Do not call.
  43.      */
  44.     @Deprecated(since="16", forRemoval=true)
  45.     public Main(){}
  46.  
  47.     /** Main entry point for the launcher.
  48.      *  Note: This method calls System.exit.
  49.      *  @param args command line arguments
  50.      *  @throws Exception only if an uncaught internal exception occurs;
  51.      *      just retained for historical compatibility
  52.      */
  53.     public static void main(String[] args) throws Exception {
  54.         System.exit(compile(args));
  55.     }
  56.  
  57.     /** Programmatic interface to the Java Programming Language
  58.      * compiler, javac.
  59.      *
  60.      * @param args The command line arguments that would normally be
  61.      * passed to the javac program as described in the man page.
  62.      * @return an integer equivalent to the exit value from invoking
  63.      * javac, see the man page for details.
  64.      */
  65.     public static int compile(String[] args) {
  66.         com.sun.tools.javac.main.Main compiler =
  67.             new com.sun.tools.javac.main.Main("javac");
  68.         return compiler.compile(args).exitCode;
  69.     }
  70.  
  71.  
  72.  
  73.     /** Programmatic interface to the Java Programming Language
  74.      * compiler, javac.
  75.      *
  76.      * @param args The command line arguments that would normally be
  77.      * passed to the javac program as described in the man page.
  78.      * @param out PrintWriter to which the compiler's diagnostic
  79.      * output is directed.
  80.      * @return an integer equivalent to the exit value from invoking
  81.      * javac, see the man page for details.
  82.      */
  83.     public static int compile(String[] args, PrintWriter out) {
  84.         com.sun.tools.javac.main.Main compiler =
  85.             new com.sun.tools.javac.main.Main("javac", out);
  86.         return compiler.compile(args).exitCode;
  87.     }
  88. }
  89.  
  90.    
  91.    
  92.    
  93.     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  94.     xmlns:tools="http://schemas.android.com/tools"
  95.     android:layout_width="match_parent"
  96.     android:layout_height="match_parent"
  97.     android:paddingBottom="@dimen/activity_vertical_margin"
  98.     android:paddingLeft="@dimen/activity_horizontal_margin"
  99.     android:paddingRight="@dimen/activity_horizontal_margin"
  100.     android:paddingTop="@dimen/activity_vertical_margin"
  101.     tools:context="com.javacodegeeks.android.loginapp.MainActivity" >
  102.  
  103.      <TextView
  104.           android:id="@+id/textView1"
  105.           android:layout_width="wrap_content"
  106.           android:layout_height="wrap_content"
  107.           android:layout_alignParentTop="true"
  108.           android:layout_centerHorizontal="true"
  109.           android:layout_marginTop="20dp"
  110.           android:text="Authentication Required"
  111.           android:textAppearance="?android:attr/textAppearanceLarge" />
  112.      
  113.       <TextView
  114.           android:id="@+id/textView2"
  115.           android:layout_width="wrap_content"
  116.           android:layout_height="wrap_content"
  117.           android:layout_alignParentLeft="true"
  118.           android:layout_below="@+id/textView1"
  119.           android:layout_marginTop="75dp"
  120.           android:layout_marginLeft="10dp"
  121.           android:text="Username:"
  122.           android:textAppearance="?android:attr/textAppearanceMedium" />
  123.        
  124.       <EditText
  125.           android:id="@+id/usernameET"
  126.           android:layout_width="wrap_content"
  127.           android:layout_height="wrap_content"
  128.           android:layout_alignBottom="@+id/textView2"
  129.           android:layout_marginLeft="35dp"
  130.           android:layout_toRightOf="@+id/textView2"
  131.           android:hint="supermode75" >
  132.           <requestFocus />
  133.       </EditText>
  134.        
  135.       <TextView
  136.           android:id="@+id/textView3"
  137.           android:layout_width="wrap_content"
  138.           android:layout_height="wrap_content"
  139.           android:layout_alignLeft="@+id/textView2"
  140.           android:layout_below="@+id/textView2"
  141.           android:layout_marginTop="40dp"
  142.           android:text="Password:"
  143.           android:textAppearance="?android:attr/textAppearanceMedium" />
  144.        
  145.       <EditText
  146.           android:id="@+id/passwordET"
  147.           android:layout_width="wrap_content"
  148.           android:layout_height="wrap_content"
  149.           android:layout_alignBottom="@+id/textView3"
  150.           android:layout_alignLeft="@+id/usernameET"
  151.           android:layout_alignRight="@+id/usernameET"
  152.           android:hint="testpass"
  153.           android:inputType="textPassword" />
  154.        
  155.        <TextView
  156.           android:id="@+id/attemptsLeftTV"
  157.           android:layout_width="wrap_content"
  158.           android:layout_height="wrap_content"
  159.           android:layout_alignLeft="@+id/textView3"
  160.           android:layout_below="@+id/textView3"
  161.           android:layout_marginLeft="30dp"
  162.           android:layout_marginTop="48dp"
  163.           android:text="Attempts Left:"
  164.           android:visibility="invisible"
  165.           android:textAppearance="?android:attr/textAppearanceMedium" />
  166.        
  167.        <Button
  168.           android:id="@+id/loginBtn"
  169.           android:layout_width="wrap_content"
  170.           android:layout_height="wrap_content"
  171.           android:layout_below="@+id/passwordET"
  172.           android:layout_centerHorizontal="true"
  173.           android:layout_marginTop="94dp"
  174.           android:onClick="authenticateLogin"
  175.           android:text="Login" />
  176.        
  177.        <TextView
  178.           android:id="@+id/numberOfRemainingLoginAttemptsTV"
  179.           android:layout_width="wrap_content"
  180.           android:layout_height="wrap_content"
  181.           android:layout_alignRight="@+id/textView1"
  182.           android:layout_alignTop="@+id/attemptsLeftTV"
  183.           android:visibility="invisible" />
  184.        
  185.        <TextView
  186.           android:id="@+id/loginLockedTV"
  187.           android:layout_width="wrap_content"
  188.           android:layout_height="wrap_content"
  189.           android:layout_below="@+id/loginBtn"
  190.           android:layout_marginTop="35dp"
  191.           android:layout_centerHorizontal="true"
  192.           android:textAppearance="?android:attr/textAppearanceMedium"
  193.           android:visibility="invisible" />
  194.  
  195. </RelativeLayout>
  196.    
  197.    
  198.    
  199.    
  200.    
  201.    
  202.    
  203.    
  204.    
  205.    
  206.    
  207.    
  208.     <?xml version="1.0" encoding="utf-8"?>
  209. <menu xmlns:android="http://schemas.android.com/apk/res/android">
  210.     <item android:id="@[+][package:]id/resource_name"
  211.           android:title="string"
  212.           android:titleCondensed="string"
  213.           android:icon="@[package:]drawable/drawable_resource_name"
  214.           android:onClick="method name"
  215.           android:showAsAction=["ifRoom" | "never" | "withText" | "always" | "collapseActionView"]
  216.           android:actionLayout="@[package:]layout/layout_resource_name"
  217.           android:actionViewClass="class name"
  218.           android:actionProviderClass="class name"
  219.           android:alphabeticShortcut="string"
  220.           android:alphabeticModifiers=["META" | "CTRL" | "ALT" | "SHIFT" | "SYM" | "FUNCTION"]
  221.           android:numericShortcut="string"
  222.           android:numericModifiers=["META" | "CTRL" | "ALT" | "SHIFT" | "SYM" | "FUNCTION"]
  223.           android:checkable=["true" | "false"]
  224.           android:visible=["true" | "false"]
  225.           android:enabled=["true" | "false"]
  226.           android:menuCategory=["container" | "system" | "secondary" | "alternative"]
  227.           android:orderInCategory="integer" />
  228.     <group android:id="@[+][package:]id/resource name"
  229.            android:checkableBehavior=["none" | "all" | "single"]
  230.            android:visible=["true" | "false"]
  231.            android:enabled=["true" | "false"]
  232.            android:menuCategory=["container" | "system" | "secondary" | "alternative"]
  233.            android:orderInCategory="integer" >
  234.         <item />
  235.     </group>
  236.     <item >
  237.         <menu>
  238.           <item />
  239.         </menu>
  240.     </item>
  241. </menu>
  242.    
  243. </root>
  244.