Android Open Source - KeepMySecret Entry Present Activity






From Project

Back to project page KeepMySecret.

License

The source code is released under:

GNU General Public License

If you think the Android project KeepMySecret listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package keepmysecretapp.app.com.keepmysecretapp.activities.presentation;
/*from   w  w  w  .j  a v  a 2 s  . c  o m*/
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import keepmysecretapp.app.com.keepmysecretapp.R;
import keepmysecretapp.app.com.keepmysecretapp.activities.MainActivity;
import keepmysecretapp.app.com.keepmysecretapp.activities.edit.EditEntryActivity;
import keepmysecretapp.app.com.keepmysecretapp.db.EntryType;
import keepmysecretapp.app.com.keepmysecretapp.fragments.presentation.EntryPresentFragment;
import keepmysecretapp.app.com.keepmysecretapp.other.Constants;
import keepmysecretapp.app.com.keepmysecretapp.types.ListEntry;

public class EntryPresentActivity extends FragmentActivity {

    private TextView entryTitle;
    private ImageView mBackButton;
    private ImageView editGroupButton;
    private ImageView deleteGroupButton;
    private int parentEntryId;
    private String entryType; // auth data or group


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_entry);

        entryTitle = (TextView) findViewById(R.id.entry_title);
        mBackButton = (ImageView) findViewById(R.id.toMainActivityButton);
        getBackButtonListener(mBackButton);

        entryTitle.setText(getIntent().getStringExtra(Constants.ENTRY_TITLE));
        entryType = getIntent().getStringExtra(Constants.ENTRY_TYPE);
        parentEntryId = getIntent().getIntExtra(Constants.ENTRY_ID, 0);


        editGroupButton = (ImageView) findViewById(R.id.entries_edit_group_button);
        getEditGroupButtonListener(editGroupButton);

        ListEntry entry = new ListEntry();
        entry.setID(parentEntryId);
        entry.setName(entryTitle.getText().toString());

        FragmentManager fragmentManager = getSupportFragmentManager();
        fragmentManager.beginTransaction().replace(R.id.text_entries_container,
                EntryPresentFragment.newInstance(entry)).commit();

    }

    private void getBackButtonListener(ImageView button) {

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent toMain = new Intent(EntryPresentActivity.this, MainActivity.class);
                startActivity(toMain);
            }
        });

    }

    private void getEditGroupButtonListener(ImageView button) {
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent toEdit = new Intent(EntryPresentActivity.this, EditEntryActivity.class);
                toEdit.putExtra(Constants.ENTRY_TYPE, EntryType.GROUPS.getName());
                toEdit.putExtra(Constants.ARG_PARENT_NAME, entryTitle.getText().toString());
                startActivity(toEdit);
            }
        });
    }
}




Java Source Code List

keepmysecretapp.app.com.keepmysecretapp.ApplicationTest.java
keepmysecretapp.app.com.keepmysecretapp.activities.MainActivity.java
keepmysecretapp.app.com.keepmysecretapp.activities.creation.CreateNewEntryActivity.java
keepmysecretapp.app.com.keepmysecretapp.activities.edit.EditEntryActivity.java
keepmysecretapp.app.com.keepmysecretapp.activities.presentation.EntryPresentActivity.java
keepmysecretapp.app.com.keepmysecretapp.adapters.DataEntryAdapter.java
keepmysecretapp.app.com.keepmysecretapp.adapters.GroupEntryAdapter.java
keepmysecretapp.app.com.keepmysecretapp.dao.Dao.java
keepmysecretapp.app.com.keepmysecretapp.dao.EntryDao.java
keepmysecretapp.app.com.keepmysecretapp.dao.GroupDao.java
keepmysecretapp.app.com.keepmysecretapp.db.DbContext.java
keepmysecretapp.app.com.keepmysecretapp.db.EntryType.java
keepmysecretapp.app.com.keepmysecretapp.fragments.creation.CreateDataEntryFragment.java
keepmysecretapp.app.com.keepmysecretapp.fragments.creation.CreateGroupFragment.java
keepmysecretapp.app.com.keepmysecretapp.fragments.dialogs.GeneratePasswordDialog.java
keepmysecretapp.app.com.keepmysecretapp.fragments.edit.EditDataFragment.java
keepmysecretapp.app.com.keepmysecretapp.fragments.edit.EditGroupFragment.java
keepmysecretapp.app.com.keepmysecretapp.fragments.other.NavigationDrawerFragment.java
keepmysecretapp.app.com.keepmysecretapp.fragments.other.SideLogic.java
keepmysecretapp.app.com.keepmysecretapp.fragments.presentation.EntryPresentFragment.java
keepmysecretapp.app.com.keepmysecretapp.fragments.presentation.TextKeeperFragment.java
keepmysecretapp.app.com.keepmysecretapp.other.Constants.java
keepmysecretapp.app.com.keepmysecretapp.other.Tools.java
keepmysecretapp.app.com.keepmysecretapp.tables.AuthTable.java
keepmysecretapp.app.com.keepmysecretapp.tables.DataTable.java
keepmysecretapp.app.com.keepmysecretapp.tables.GroupTable.java
keepmysecretapp.app.com.keepmysecretapp.tables.QueryTable.java
keepmysecretapp.app.com.keepmysecretapp.types.CopyTextButtonListener.java
keepmysecretapp.app.com.keepmysecretapp.types.GenerateButtonListener.java
keepmysecretapp.app.com.keepmysecretapp.types.ListEntry.java