Skip to content
Snippets Groups Projects
Commit 3e41aa44 authored by vivek1826's avatar vivek1826
Browse files

updates

parent b50b5997
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ public class Float extends AppCompatActivity {
button=(Button)findViewById(R.id.button);
databaseHelperTwo=new DatabaseHelperTwo(getApplicationContext());
databaseHelperTwo.searchpass();
//databaseHelperTwo.searchpass();
s=new Session(this);
if (!s.loggedIn()){
......
......@@ -104,7 +104,7 @@ String[] a,b,c;
try {
viewHolder.itemImage.setImageBitmap(bitmapArray.get(i));
}catch (IndexOutOfBoundsException e){
viewHolder.itemImage.setImageBitmap(null);
}
}
......
package com.example.srinivasan.database2;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Handler;
......@@ -11,6 +13,7 @@ import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.PopupWindow;
......@@ -19,12 +22,13 @@ import android.widget.TextView;
import java.util.ArrayList;
import static android.R.attr.editTextStyle;
import static android.R.attr.handle;
public class SingleView extends AppCompatActivity {
public class SingleView extends AppCompatActivity implements View.OnClickListener{
DatabaseHelperTwo db2;
String[] date, time, query , locat;
TextView date1, time1, com1 ,location ;
TextView date1, time1, com1 ,location ,comments,typecom,butcom;
ProgressBar progressBar;
FloatingActionButton fab;
ProgressDialog progress;
......@@ -32,7 +36,10 @@ public class SingleView extends AppCompatActivity {
private TextView textView;
PopupWindow popupWindow;
private Handler handler = new Handler();
SharedPreferences sharedpreferences;
public static final String MyPREFERENCES = "MyPrefs" ;
public static final String textsave = null;
int position;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -42,11 +49,15 @@ public class SingleView extends AppCompatActivity {
time1 = (TextView) findViewById(R.id.texttime);
com1 = (TextView) findViewById(R.id.comm);
location = (TextView)findViewById(R.id.location);
comments = (TextView)findViewById(R.id.comments);
typecom = (EditText)findViewById(R.id.typecom);
butcom = (Button)findViewById(R.id.butcom);
butcom.setOnClickListener(this);
// Get intent data
popupWindow = new PopupWindow(this);
Intent i = getIntent();
// Selected image id
int position = i.getExtras().getInt("i");
position = i.getExtras().getInt("i");
//ImageAdapter imageAdapter = new ImageAdapter(this);
ArrayList<Bitmap> bitmapArray = new ArrayList<Bitmap>();
bitmapArray = db2.searchpass();
......@@ -62,6 +73,12 @@ public class SingleView extends AppCompatActivity {
}
});
*/
sharedpreferences = getSharedPreferences("text",0);
//SharedPreferences.Editor sedt = sharedpreferences.edit();
String newtw = sharedpreferences.getString("text","");
comments.setText(newtw);
ImageView imageView = (ImageView) findViewById(R.id.SingleView);
//imageView.setImageResource(imageAdapter.mThumbIds[position]);
imageView.setImageBitmap(bitmapArray.get(position));
......@@ -71,9 +88,17 @@ public class SingleView extends AppCompatActivity {
location.setText(locat[position]);
}
/*public void Comment(View v){
String a;
a = typecom.getText().toString();
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString(textsave, a);
editor.commit();
comments.append(++i + " . "+ a + "\n\n");
}
public void pro(View v) {
/*
progress = new ProgressDialog(SingleView.this);
progress.setMax(100);
progress.setMessage("Work on Progress");
......@@ -104,7 +129,17 @@ public class SingleView extends AppCompatActivity {
public void handleMessage(Message msg) {
super.handleMessage(msg);
progress.incrementProgressBy(1);
}
}*/
@Override
public void onClick(View v) {
String a;
a = typecom.getText().toString();
comments.append("->"+ a + "\n\n");
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString("text",comments.getText().toString());
editor.commit();
}
}
......@@ -14,7 +14,7 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
......
......@@ -142,5 +142,42 @@
android:textColor="@android:color/holo_blue_bright"
android:textSize="24sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/LinearLayout06"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/LinearLayout05"
android:orientation="vertical"
android:paddingTop="30dp">
<TextView
android:id="@+id/textView10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Comments :"
android:textSize="30sp" />
<TextView
android:id="@+id/comments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textSize="30sp" />
<EditText
android:id="@+id/typecom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName" />
<Button
android:id="@+id/butcom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Submit Comment" />
</LinearLayout>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment