Skip to content

Commit

Permalink
improved search
Browse files Browse the repository at this point in the history
  • Loading branch information
Innotebook committed Sep 1, 2012
1 parent 8b12d7f commit a4843eb
Show file tree
Hide file tree
Showing 51 changed files with 101 additions and 43 deletions.
Empty file modified .classpath
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .project
100644 → 100755
Empty file.
Empty file modified .settings/org.eclipse.jdt.core.prefs
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion AndroidManifest.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" />

<uses-permission android:name="android.permission.INTERNET" />
<permission android:name="android.permission.INTERNET"></permission>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
Expand Down
Empty file modified README
100644 → 100755
Empty file.
Empty file modified proguard.cfg
100644 → 100755
Empty file.
Empty file modified project.properties
100644 → 100755
Empty file.
Empty file modified res/drawable-hdpi/commingsoonp.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-hdpi/england.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-hdpi/georgia.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-hdpi/gtugtbilisi.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-hdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-hdpi/ic_launcherold.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-hdpi/icon.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-hdpi/tbilisigtug.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-ldpi/gtugtbilisi.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-ldpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-ldpi/ic_launcherold.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-ldpi/icon.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-mdpi/gtugtbilisi.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-mdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/drawable-mdpi/search.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified res/layout/about.xml
100644 → 100755
Empty file.
30 changes: 8 additions & 22 deletions res/layout/detail.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="4px"
android:background="#FFFFFF" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<!--
<include
android:id="@+id/detail_inc"
layout="@layout/detail_inc" />
-->
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<ImageView
android:id="@+id/imageCommingSoon"
android:layout_width="wrap_content"
android:layout_marginTop="200dp"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/commingsoonp" />



</RelativeLayout>
</LinearLayout>
8 changes: 4 additions & 4 deletions res/layout/detail_inc.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingTop="4px">

Expand All @@ -15,8 +15,8 @@

<TextView
android:id="@+id/selectedWord"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="Comming soon..."
Expand Down
Empty file modified res/layout/list_color.xml
100644 → 100755
Empty file.
Empty file modified res/layout/main.xml
100644 → 100755
Empty file.
Empty file modified res/layout/main_header_color.xml
100644 → 100755
Empty file.
Empty file modified res/layout/search.xml
100644 → 100755
Empty file.
Empty file modified res/layout/word_list_item.xml
100644 → 100755
Empty file.
Empty file modified res/menu/gtug_menu.xml
100644 → 100755
Empty file.
Empty file modified res/raw/enggeoaa
100644 → 100755
Empty file.
Empty file modified res/raw/enggeoab
100644 → 100755
Empty file.
Empty file modified res/raw/enggeoac
100644 → 100755
Empty file.
Empty file modified res/raw/enggeoad
100644 → 100755
Empty file.
Empty file modified res/raw/enggeoae
100644 → 100755
Empty file.
Empty file modified res/raw/enggeoaf
100644 → 100755
Empty file.
Empty file modified res/raw/enggeoag
100644 → 100755
Empty file.
Empty file modified res/raw/enggeoah
100644 → 100755
Empty file.
Empty file modified res/raw/enggeoai
100644 → 100755
Empty file.
Empty file modified res/values/strings.xml
100644 → 100755
Empty file.
Binary file added src/GtugDictionary.apk
Binary file not shown.
Empty file modified src/ge/gtug/dictionary/ASCII2UTF8Converter.java
100644 → 100755
Empty file.
Empty file modified src/ge/gtug/dictionary/About.java
100644 → 100755
Empty file.
65 changes: 57 additions & 8 deletions src/ge/gtug/dictionary/DetailActivity.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,24 +1,73 @@
package ge.gtug.dictionary;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.EditText;
import android.widget.TextView;

public class DetailActivity extends Activity {
TextView tv;
String selectedWord;
WebView mWebView;
String[] words;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.detail);

// Bundle extras = getIntent().getExtras();
// if (extras == null) {
// return;
// }
// selectedWord = extras.getString("selectedWord");
// tv = (TextView) findViewById(R.id.selectedWord);
// tv.setText(selectedWord);
// words = selectedWord.split("-");


/*Bundle extras = getIntent().getExtras();
if (extras == null) {
return;
}
selectedWord = extras.getString("selectedWord");
tv = (TextView) findViewById(R.id.selectedWord);
tv.setText(selectedWord);*/
WebViewClient yourWebClient = new WebViewClient()
{
// Override page so it's load on my view only
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
// This line we let me load only pages inside Firstdroid Webpage
if ( url.contains("firstdroid") == true )
// Load new URL Don't override URL Link
return false;

// Return true to override url loading (In this case do nothing).
return true;
}
};


// Get Web view
mWebView = (WebView) findViewById( R.id.webView1 ); //This is the id you gave
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setSupportZoom(true); //Zoom Control on web (You don't need this
//if ROM supports Multi-Touch
mWebView.getSettings().setBuiltInZoomControls(true); //Enable Multitouch if supported by ROM
mWebView.setWebViewClient(yourWebClient);

// Load URL
mWebView.loadUrl("http://www.google.com");



}
}

}
37 changes: 29 additions & 8 deletions src/ge/gtug/dictionary/GtugDictionaryActivity.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,32 @@ public void onCreate(Bundle savedInstanceState) {
public void onTextChanged(CharSequence s, int start, int before,
int count) {
// TODO Auto-generated method stub


search(prog);
// Log.d("After Thread", "Message");


}

public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub

// Log.d("Log", "beforeTextChanged");
}



public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub

/*Thread.currentThread();
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}*/
// Log.d("Log", "afterTextChanged");
}
});
button.setOnClickListener(new OnClickListener() {
Expand Down Expand Up @@ -120,19 +134,26 @@ public void search(View view) {

new Thread(new Runnable() {
public void run() {
try {
Thread.currentThread().sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Log.d("thread", "end");
ArrayList<TranslationEntry> result = new ArrayList();
WordTranslator db = new WordTranslator(
GtugDictionaryActivity.this);
String text = searchText.getText().toString().trim();
if (text.equals("") || text.trim().length() == 0) {
} else if (isGeo) {
myDbHelper.openDataBase();
// myDbHelper.openDataBase();
result = db.translateWord(text, true, this);
myDbHelper.close();
// myDbHelper.close();
} else {
myDbHelper.openDataBase();
// myDbHelper.openDataBase();
result = db.translateWord(text, false, this);
myDbHelper.close();
// myDbHelper.close();
}
wordList = new ArrayList();
if (isGeo) {
Expand Down
1 change: 1 addition & 0 deletions src/ge/gtug/dictionary/bl/WordTranslator.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public ArrayList<TranslationEntry> translateWord(String text,
} else {
result.add(new TranslationEntry("Not Found", "Not Found"));
}
db.close();
c.close();
return result;
}
Expand Down
Empty file modified src/ge/gtug/dictionary/database/DBHelper.java
100644 → 100755
Empty file.
Empty file modified src/ge/gtug/dictionary/database/DbNames.java
100644 → 100755
Empty file.
Empty file modified src/ge/gtug/dictionary/enrty/TranslationEntry.java
100644 → 100755
Empty file.

0 comments on commit a4843eb

Please sign in to comment.