GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — QuickAndroid/QuickAndroidMain.java at master · alimogh/QuickAndroid

Expand file tree

/

QuickAndroidMain.java

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
60 lines (53 loc) · 2.16 KB
/

QuickAndroidMain.java

Copy path

File metadata and controls

60 lines (53 loc) · 2.16 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
/**
* QuickAndroidMain
* @organisation: eSprinkle
* @version: 1.0.2
**/
public class QuickAndroidMain {
public static void main(String[] args){
@SuppressWarnings("resource")
Scanner s=new Scanner(System.in);
try{
System.out.println("Please input Layout File Name [ex: Login.xml]");
String layoutFileName=s.next().toString();
if(layoutFileName==null||layoutFileName.trim().equals("")){
System.out.println("Exiting program ");
return;
}
Path thisFolder=Paths.get(System.getProperty("user.dir"));
ActivityReader ar=new ActivityReader(thisFolder.resolve(Paths.get("res/layout/"+layoutFileName)).toAbsolutePath().toString());
List<ViewType> viewList=ar.getActivityList();
Map<String,String> meta=ar.getActivityMeta();
if(meta.get("is_new").equals("true")){
CreateClass javaClass=new CreateClass();
String className=(meta.get("class")!=null?meta.get("class"):layoutFileName.substring(0,layoutFileName.length()-4));
className=className.substring(0,1).toUpperCase()+className.substring(1).toLowerCase();
Path classLocationPath=thisFolder.resolve(Paths.get("src/"+(meta.get("package")!=null?meta.get("package").replaceAll("\\.", "/"):"")+"/"+className+".java").toAbsolutePath());
//Override warning
if(Files.exists(classLocationPath)){
System.out.println("You can also change the class name in layout file. ");
System.out.println("The "+className+" already exists, Do you want to override? [Y/N]");
String overrideConfirmation=s.next().toString();
if(overrideConfirmation==null||overrideConfirmation.trim().equals("")||!overrideConfirmation.trim().equals("Y")){
System.out.println("Exiting program ");
return;
}
}
if(javaClass.embedCode(viewList, layoutFileName,meta.get("package"),className,classLocationPath)){
System.out.println("Class file created successfully, refresh src folder");
}
}
}
catch(Exception ex){
System.err.print(ex.toString());
System.out.println("Press enter to exit ");
s.next();
}
}
}
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.