repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
TheCreeperOfRedstone/RPG-Items-2 | src/think/rpgitems/config/ConfigUpdater.java | // Path: src/think/rpgitems/Plugin.java
// @SuppressWarnings("deprecation")
// public class Plugin extends JavaPlugin {
//
// public static Logger logger = Logger.getLogger("RPGItems");
//
// public static Plugin plugin;
//
// @Override
// public void onLoad() {
// plugin = this;
// ... | import java.util.HashMap;
import org.bukkit.configuration.ConfigurationSection;
import think.rpgitems.Plugin; | static {
updates = new HashMap<String, Updater>();
updates.put("0.1", new Update01To02());
updates.put("0.2", new Update02To03());
updates.put("0.3", new Update03To04());
updates.put("0.4", new Update04To05());
}
public static void updateConfig(ConfigurationSection c... | // Path: src/think/rpgitems/Plugin.java
// @SuppressWarnings("deprecation")
// public class Plugin extends JavaPlugin {
//
// public static Logger logger = Logger.getLogger("RPGItems");
//
// public static Plugin plugin;
//
// @Override
// public void onLoad() {
// plugin = this;
// ... | Plugin.plugin.saveConfig(); |
TheCreeperOfRedstone/RPG-Items-2 | src/think/rpgitems/config/Update01To02.java | // Path: src/think/rpgitems/Plugin.java
// @SuppressWarnings("deprecation")
// public class Plugin extends JavaPlugin {
//
// public static Logger logger = Logger.getLogger("RPGItems");
//
// public static Plugin plugin;
//
// @Override
// public void onLoad() {
// plugin = this;
// ... | import java.io.File;
import java.io.IOException;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import think.rpgitems.Plugin; | /*
* This file is part of RPG Items.
*
* RPG Items is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RPG Items is distr... | // Path: src/think/rpgitems/Plugin.java
// @SuppressWarnings("deprecation")
// public class Plugin extends JavaPlugin {
//
// public static Logger logger = Logger.getLogger("RPGItems");
//
// public static Plugin plugin;
//
// @Override
// public void onLoad() {
// plugin = this;
// ... | File iFile = new File(Plugin.plugin.getDataFolder(), "items.yml"); |
TheCreeperOfRedstone/RPG-Items-2 | src/think/rpgitems/data/Font.java | // Path: src/think/rpgitems/Plugin.java
// @SuppressWarnings("deprecation")
// public class Plugin extends JavaPlugin {
//
// public static Logger logger = Logger.getLogger("RPGItems");
//
// public static Plugin plugin;
//
// @Override
// public void onLoad() {
// plugin = this;
// ... | import java.io.IOException;
import java.io.InputStream;
import think.rpgitems.Plugin; | /*
* This file is part of RPG Items.
*
* RPG Items is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RPG Items is distr... | // Path: src/think/rpgitems/Plugin.java
// @SuppressWarnings("deprecation")
// public class Plugin extends JavaPlugin {
//
// public static Logger logger = Logger.getLogger("RPGItems");
//
// public static Plugin plugin;
//
// @Override
// public void onLoad() {
// plugin = this;
// ... | InputStream in = Plugin.plugin.getResource("font.bin"); |
bonigarcia/dualsub | src/test/java/io/github/bonigarcia/dualsub/test/TestCharset.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/Charset.java
// public class Charset {
//
// public static String ISO88591 = "ISO-8859-1";
// public static String UTF8 = "UTF-8";
//
// private static Charset singleton = null;
//
// private UniversalDetector detector;
//
// public Charset() {
// dete... | import io.github.bonigarcia.dualsub.util.Charset;
import java.io.IOException;
import java.io.InputStream;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.SAXException; | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/Charset.java
// public class Charset {
//
// public static String ISO88591 = "ISO-8859-1";
// public static String UTF8 = "UTF-8";
//
// private static Charset singleton = null;
//
// private UniversalDetector detector;
//
// public Charset() {
// dete... | log.info(Charset.detect(isEnFile)); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/PanelPlayer.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/Font.java
// public class Font {
//
// private List<String> fontList;
// private String[] widthList;
// private static Properties properties;
// private static Font singleton = null;
//
// public Font() {
// fontList = new ArrayList<String>();
// width... | import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.bonigarcia.dualsub.util.Font;
import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.Color;
import java... | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/Font.java
// public class Font {
//
// private List<String> fontList;
// private String[] widthList;
// private static Properties properties;
// private static Font singleton = null;
//
// public Font() {
// fontList = new ArrayList<String>();
// width... | .getBorder("TitledBorder.border"), I18N |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/PanelPlayer.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/Font.java
// public class Font {
//
// private List<String> fontList;
// private String[] widthList;
// private static Properties properties;
// private static Font singleton = null;
//
// public Font() {
// fontList = new ArrayList<String>();
// width... | import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.bonigarcia.dualsub.util.Font;
import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.Color;
import java... | this.setBorder(new TitledBorder(UIManager
.getBorder("TitledBorder.border"), I18N
.getHtmlText("PanelPlayer.border.text"), TitledBorder.LEADING,
TitledBorder.TOP, null, null));
this.setBounds(46, 220, 305, 111);
this.setBackground(parent.getBackground());
// Width
JLabel lblWitdh = new JLabel(
... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/Font.java
// public class Font {
//
// private List<String> fontList;
// private String[] widthList;
// private static Properties properties;
// private static Font singleton = null;
//
// public Font() {
// fontList = new ArrayList<String>();
// width... | fontComboBox.setModel(new DefaultComboBoxModel<String>(Font |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/HelpTimingDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import javax.swing.border.Border;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.bonigarcia.dualsub.util.I18N;
import io.github.bonigarcia.dualsub.util.I18N.Html;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.BorderFac... | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | final String title = I18N.getHtmlText("PanelOutput.border.text"); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/HelpTimingDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import javax.swing.border.Border;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.bonigarcia.dualsub.util.I18N;
import io.github.bonigarcia.dualsub.util.I18N.Html;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.BorderFac... | protected void initComponents() {
// Features
final int marginLeft = 23;
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.setResizable(false);
getContentPane().setLayout(new BorderLayout());
JPanel panel = new JPanel();
panel.setLayout(null);
panel.setPreferredSize(new Dimension(ge... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | "HelpTimingDialog.help.02", Html.BOLD)); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/CharsetItem.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import io.github.bonigarcia.dualsub.util.I18N; | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | return I18N.HTML_INIT_TAG + output + I18N.HTML_END_TAG; |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/HelpOutputDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.bonigarcia.dualsub.util.I18N;
import io.github.bonigarcia.dualsub.util.I18N.Html;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
i... | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | final String title = I18N.getHtmlText("PanelOutput.border.text"); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/HelpOutputDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.bonigarcia.dualsub.util.I18N;
import io.github.bonigarcia.dualsub.util.I18N.Html;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
i... | protected void initComponents() {
// Features
final int marginLeft = 23;
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.setResizable(false);
getContentPane().setLayout(new BorderLayout());
JPanel panel = new JPanel();
panel.setLayout(null);
panel.setPreferredSize(new Dimension(ge... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | "HelpOutputDialog.help.02", Html.MONOSPACE)); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/KeyTranslationDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Rectangle;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
imp... | /*
* (C) Copyright 2017 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | final String title = I18N.getHtmlText("KeyTranslation.border.text"); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/KeyTranslationDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Rectangle;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
imp... | protected void initComponents() {
// Features
final int marginLeft = 30;
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.setResizable(false);
getContentPane().setLayout(new BorderLayout());
JPanel panel = new JPanel();
panel.setLayout(null);
panel.setPreferredSize(new Dimension(ge... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | I18N.getHtmlText("KeyTranslation.help.02", Html.LINK), |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/srt/Merger.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import io.github.bonigarcia.dualsub.util.I18N;
import java.io.File;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | } else {
dualSrt.addEntry(t, new Entry[] { subtitlesLeft.get(t),
new Entry() });
}
}
if (!subtitlesRight.isEmpty()) {
for (String t : subtitlesRight.keySet()) {
log.debug("Desynchronization on " + t + " "
+ subtitlesRight.get(t).subtitleLines);
dualSrt.processDesync(t, su... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | mergedFileName += " " + I18N.getText("Merger.merged.text"); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/HelpTranslationDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScroll... | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | final String title = I18N.getHtmlText("PanelTranslation.border.text"); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/PanelTranslation.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Collections;
import java.util.Vector;
import java.util.prefs.Preferences;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIc... | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | I18N.getHtmlText("PanelTranslation.border.text"), |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/PanelTiming.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax... | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | .getBorder("TitledBorder.border"), I18N |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/ExceptionDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Point;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
... | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | setTitle(I18N.getText("Window.name.text")); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/srt/DualSrt.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CodingErrorAction;
import java.text.ParseExcept... | (s + SrtUtils.EOL).getBytes(Charset.forName(charsetStr)));
fileChannel.write(byteBuffer);
}
byteBuffer = ByteBuffer
.wrap(SrtUtils.EOL.getBytes(Charset.forName(charsetStr)));
fileChannel.write(byteBuffer);
fileChannel.close();
fileOutputStream.close();
}
/**
* Adds an entry in the end of the... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | signatureText = I18N.getText("Merger.signatureboth.text"); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/AddFileListener.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.filechooser.FileFilter; | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | return I18N.getHtmlText("AddFileListener.fileChooser.text"); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/Menu.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.security.CodeSource;
import java.util.Enumeration;
... | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | JMenu subtitleMenu = new JMenu(I18N.getHtmlText("Menu.actions.text")); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/Alert.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import io.github.bonigarcia.dualsub.util.I18N;
import javax.swing.JFrame;
import javax.swing.JOptionPane; | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | I18N.getText("Window.name.text"), JOptionPane.ERROR_MESSAGE); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/LangListener.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.prefs.Preferences; | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | Alert.info(I18N.getHtmlText("LangListener.changes.alert")); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/HelpPlayerDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import javax.swing.WindowConstants;
import javax.swing.border.Border;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.bonigarcia.dualsub.util.I18N;
import io.github.bonigarcia.dualsub.util.I18N.Html;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.aw... | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | final String title = I18N.getHtmlText("PanelOutput.border.text"); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/HelpPlayerDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import javax.swing.WindowConstants;
import javax.swing.border.Border;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.bonigarcia.dualsub.util.I18N;
import io.github.bonigarcia.dualsub.util.I18N.Html;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.aw... | protected void initComponents() {
// Features
final int marginLeft = 23;
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.setResizable(false);
getContentPane().setLayout(new BorderLayout());
JPanel panel = new JPanel();
panel.setLayout(null);
panel.setPreferredSize(new Dimension(ge... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | "HelpPlayerDialog.help.02", Html.LINK), parent.getCursor(), |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/HelpSubtitlesDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPan... | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | final String title = I18N.getHtmlText("Window.mergeButton.text"); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/AboutDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/Charset.java
// public class Charset {
//
// public static String ISO88591 = "ISO-8859-1";
// public static String UTF8 = "UTF-8";
//
// private static Charset singleton = null;
//
// private UniversalDetector detector;
//
// public Charset() {
// dete... | import io.github.bonigarcia.dualsub.util.Charset;
import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import ja... |
public AboutDialog(DualSub parent, boolean modal) {
super(parent.getFrame(), modal);
this.parent = parent;
initComponents();
Runnable doScroll = new Runnable() {
public void run() {
scrollPane.getVerticalScrollBar().setValue(0);
scrollChangelog.getVerticalScrollBar().setValue(0);
scrollLicense... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/Charset.java
// public class Charset {
//
// public static String ISO88591 = "ISO-8859-1";
// public static String UTF8 = "UTF-8";
//
// private static Charset singleton = null;
//
// private UniversalDetector detector;
//
// public Charset() {
// dete... | setTitle(I18N.getText("Window.name.text")); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/AboutDialog.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/Charset.java
// public class Charset {
//
// public static String ISO88591 = "ISO-8859-1";
// public static String UTF8 = "UTF-8";
//
// private static Charset singleton = null;
//
// private UniversalDetector detector;
//
// public Charset() {
// dete... | import io.github.bonigarcia.dualsub.util.Charset;
import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import ja... | tabs.addTab(I18N.getHtmlText("About.license.text"), null, licenseTab,
null);
scrollLicense = new JScrollPane();
scrollLicense.setBounds(0, 0, 470, 327);
licenseTab.add(scrollLicense);
JTextPane txtLicense = new JTextPane();
scrollLicense.setViewportView(txtLicense);
addTextContentToArea(txtLicense, ... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/Charset.java
// public class Charset {
//
// public static String ISO88591 = "ISO-8859-1";
// public static String UTF8 = "UTF-8";
//
// private static Charset singleton = null;
//
// private UniversalDetector detector;
//
// public Charset() {
// dete... | Charset.ISO88591)); |
bonigarcia/dualsub | src/main/java/io/github/bonigarcia/dualsub/gui/PanelOutput.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import io.github.bonigarcia.dualsub.util.I18N;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.MissingResourceException;
import java.util.Vector;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.DefaultComboBoxModel;
im... | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | .getBorder("TitledBorder.border"), I18N |
bonigarcia/dualsub | src/test/java/io/github/bonigarcia/dualsub/test/TestLocale.java | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | import io.github.bonigarcia.dualsub.util.I18N;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;
import java.util.Locale;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | /*
* (C) Copyright 2014 Boni Garcia (http://bonigarcia.github.io/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versi... | // Path: src/main/java/io/github/bonigarcia/dualsub/util/I18N.java
// public class I18N {
//
// public static final String MESSAGES = "lang/messages";
//
// public static final String HTML_INIT_TAG = "<html><font face='Lucid'>";
//
// public static final String HTML_END_TAG = "</font></html>";
//
// public enum... | if (s.startsWith(I18N.MESSAGES) && s.endsWith(".properties") |
booz-allen-hamilton/lucene-hdfs-directory | src/main/java/com/bah/lucene/blockcache_v2/BaseCache.java | // Path: src/main/java/com/bah/lucene/blockcache_v2/cachevalue/ByteArrayCacheValue.java
// @SuppressWarnings("serial")
// public class ByteArrayCacheValue extends BaseCacheValue {
//
// private final byte[] _buffer;
//
// public ByteArrayCacheValue(int length) {
// super(length);
// _buffer = new byte[len... | import com.bah.lucene.blockcache_v2.cachevalue.ByteArrayCacheValue;
import com.bah.lucene.blockcache_v2.cachevalue.UnsafeCacheValue;
import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
import com.googlecode.concurrentlinkedhashmap.EvictionListener;
import com.googlecode.concurrentlinkedhashmap.Weighe... | }
}
private void addToReleaseQueue(CacheKey key, CacheValue value) {
if (value != null) {
if (value.refCount() == 0) {
value.release();
return;
}
long capacity = _cacheMap.capacity();
_cacheMap.setCapacity(capacity - value.size());
ReleaseEntry releaseEntry = ... | // Path: src/main/java/com/bah/lucene/blockcache_v2/cachevalue/ByteArrayCacheValue.java
// @SuppressWarnings("serial")
// public class ByteArrayCacheValue extends BaseCacheValue {
//
// private final byte[] _buffer;
//
// public ByteArrayCacheValue(int length) {
// super(length);
// _buffer = new byte[len... | return new ByteArrayCacheValue(cacheBlockSize); |
booz-allen-hamilton/lucene-hdfs-directory | src/main/java/com/bah/lucene/blockcache_v2/BaseCache.java | // Path: src/main/java/com/bah/lucene/blockcache_v2/cachevalue/ByteArrayCacheValue.java
// @SuppressWarnings("serial")
// public class ByteArrayCacheValue extends BaseCacheValue {
//
// private final byte[] _buffer;
//
// public ByteArrayCacheValue(int length) {
// super(length);
// _buffer = new byte[len... | import com.bah.lucene.blockcache_v2.cachevalue.ByteArrayCacheValue;
import com.bah.lucene.blockcache_v2.cachevalue.UnsafeCacheValue;
import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
import com.googlecode.concurrentlinkedhashmap.EvictionListener;
import com.googlecode.concurrentlinkedhashmap.Weighe... |
private void addToReleaseQueue(CacheKey key, CacheValue value) {
if (value != null) {
if (value.refCount() == 0) {
value.release();
return;
}
long capacity = _cacheMap.capacity();
_cacheMap.setCapacity(capacity - value.size());
ReleaseEntry releaseEntry = new Releas... | // Path: src/main/java/com/bah/lucene/blockcache_v2/cachevalue/ByteArrayCacheValue.java
// @SuppressWarnings("serial")
// public class ByteArrayCacheValue extends BaseCacheValue {
//
// private final byte[] _buffer;
//
// public ByteArrayCacheValue(int length) {
// super(length);
// _buffer = new byte[len... | return new UnsafeCacheValue(cacheBlockSize); |
booz-allen-hamilton/lucene-hdfs-directory | src/main/java/com/bah/lucene/blockcache_v2/cachevalue/UnsafeCacheValue.java | // Path: src/main/java/com/bah/lucene/blockcache_v2/CacheValue.java
// public interface CacheValue {
//
// /**
// * The actual size of the the underlying resource.
// *
// * @return the size.
// */
// int size();
//
// /**
// * The length of the data in this block.
// *
// * @return the l... | import sun.misc.Unsafe;
import java.lang.reflect.Field;
import java.util.concurrent.atomic.AtomicLong;
import com.bah.lucene.blockcache_v2.CacheValue; | protected void readInternal(int position, byte[] buf, int offset, int length) {
copyToArray(resolveAddress(position), buf, offset, length);
}
@Override
protected byte readInternal(int position) {
return _unsafe.getByte(resolveAddress(position));
}
private long resolveAddress(int position) {
re... | // Path: src/main/java/com/bah/lucene/blockcache_v2/CacheValue.java
// public interface CacheValue {
//
// /**
// * The actual size of the the underlying resource.
// *
// * @return the size.
// */
// int size();
//
// /**
// * The length of the data in this block.
// *
// * @return the l... | public CacheValue trim(int length) { |
booz-allen-hamilton/lucene-hdfs-directory | src/test/java/com/bah/lucene/blockcache_v2/cachevalue/ByteArrayCacheValueTest.java | // Path: src/main/java/com/bah/lucene/blockcache_v2/cachevalue/ByteArrayCacheValue.java
// @SuppressWarnings("serial")
// public class ByteArrayCacheValue extends BaseCacheValue {
//
// private final byte[] _buffer;
//
// public ByteArrayCacheValue(int length) {
// super(length);
// _buffer = new byte[len... | import static org.junit.Assert.*;
import org.junit.Test;
import com.bah.lucene.blockcache_v2.cachevalue.ByteArrayCacheValue; | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | // Path: src/main/java/com/bah/lucene/blockcache_v2/cachevalue/ByteArrayCacheValue.java
// @SuppressWarnings("serial")
// public class ByteArrayCacheValue extends BaseCacheValue {
//
// private final byte[] _buffer;
//
// public ByteArrayCacheValue(int length) {
// super(length);
// _buffer = new byte[len... | ByteArrayCacheValue value = new ByteArrayCacheValue(10); |
booz-allen-hamilton/lucene-hdfs-directory | src/main/java/com/bah/lucene/blockcache_v2/cachevalue/ByteArrayCacheValue.java | // Path: src/main/java/com/bah/lucene/blockcache_v2/CacheValue.java
// public interface CacheValue {
//
// /**
// * The actual size of the the underlying resource.
// *
// * @return the size.
// */
// int size();
//
// /**
// * The length of the data in this block.
// *
// * @return the l... | import com.bah.lucene.blockcache_v2.CacheValue; | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | // Path: src/main/java/com/bah/lucene/blockcache_v2/CacheValue.java
// public interface CacheValue {
//
// /**
// * The actual size of the the underlying resource.
// *
// * @return the size.
// */
// int size();
//
// /**
// * The length of the data in this block.
// *
// * @return the l... | public CacheValue trim(int length) { |
booz-allen-hamilton/lucene-hdfs-directory | src/test/java/com/bah/lucene/CacheDirectoryTestSuiteOffHeap.java | // Path: src/main/java/com/bah/lucene/blockcache_v2/BaseCache.java
// public enum STORE {
// ON_HEAP, OFF_HEAP
// }
| import org.junit.Test;
import com.bah.lucene.blockcache_v2.BaseCache.STORE; | package com.bah.lucene;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
*... | // Path: src/main/java/com/bah/lucene/blockcache_v2/BaseCache.java
// public enum STORE {
// ON_HEAP, OFF_HEAP
// }
// Path: src/test/java/com/bah/lucene/CacheDirectoryTestSuiteOffHeap.java
import org.junit.Test;
import com.bah.lucene.blockcache_v2.BaseCache.STORE;
package com.bah.lucene;
/**
* Licensed to the A... | protected STORE getStore() { |
booz-allen-hamilton/lucene-hdfs-directory | src/main/java/com/bah/lucene/blockcache_v2/CacheIndexInput.java | // Path: src/main/java/com/bah/lucene/buffer/BufferStore.java
// public class BufferStore {
//
// public static final int _1024_DEFAULT_SIZE = 8192;
// public static final int _8192_DEFAULT_SIZE = 8192;
//
// private static final Log LOG = LogFactory.getLog(BufferStore.class);
//
// private static Blocking... | import com.bah.lucene.buffer.BufferStore;
import java.io.IOException;
import org.apache.lucene.store.AlreadyClosedException;
import org.apache.lucene.store.IndexInput; |
private int remaining() {
return _cacheValue.length() - _blockPosition;
}
private void tryToFill() throws IOException {
if (_cacheValue == null) {
fill();
} else if (remaining() == 0) {
releaseCache();
fill();
} else {
return;
}
}
private void releaseCache() {
... | // Path: src/main/java/com/bah/lucene/buffer/BufferStore.java
// public class BufferStore {
//
// public static final int _1024_DEFAULT_SIZE = 8192;
// public static final int _8192_DEFAULT_SIZE = 8192;
//
// private static final Log LOG = LogFactory.getLog(BufferStore.class);
//
// private static Blocking... | byte[] buffer = BufferStore.takeBuffer(_bufferSize); |
booz-allen-hamilton/lucene-hdfs-directory | src/test/java/com/bah/lucene/BaseDirectoryTestSuite.java | // Path: src/main/java/com/bah/lucene/blockcache/LastModified.java
// public interface LastModified {
//
// long getFileModified(String name) throws IOException;
//
// }
//
// Path: src/main/java/com/bah/lucene/buffer/BufferStore.java
// public class BufferStore {
//
// public static final int _1024_DEFAULT_S... | import org.apache.lucene.analysis.core.KeywordAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.IntField;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexW... | package com.bah.lucene;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
*... | // Path: src/main/java/com/bah/lucene/blockcache/LastModified.java
// public interface LastModified {
//
// long getFileModified(String name) throws IOException;
//
// }
//
// Path: src/main/java/com/bah/lucene/buffer/BufferStore.java
// public class BufferStore {
//
// public static final int _1024_DEFAULT_S... | BufferStore.init(128, 128); |
booz-allen-hamilton/lucene-hdfs-directory | src/test/java/com/bah/lucene/BaseDirectoryTestSuite.java | // Path: src/main/java/com/bah/lucene/blockcache/LastModified.java
// public interface LastModified {
//
// long getFileModified(String name) throws IOException;
//
// }
//
// Path: src/main/java/com/bah/lucene/buffer/BufferStore.java
// public class BufferStore {
//
// public static final int _1024_DEFAULT_S... | import org.apache.lucene.analysis.core.KeywordAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.IntField;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexW... | random.nextBytes(buf);
int offset = random.nextInt(buf.length);
int length = random.nextInt(buf.length - offset);
fsOutput.writeBytes(buf, offset, length);
hdfsOutput.writeBytes(buf, offset, length);
}
fsOutput.close();
hdfsOutput.close();
}
private String getName() {
... | // Path: src/main/java/com/bah/lucene/blockcache/LastModified.java
// public interface LastModified {
//
// long getFileModified(String name) throws IOException;
//
// }
//
// Path: src/main/java/com/bah/lucene/buffer/BufferStore.java
// public class BufferStore {
//
// public static final int _1024_DEFAULT_S... | public static class DirectoryLastModified extends Directory implements LastModified { |
booz-allen-hamilton/lucene-hdfs-directory | src/test/java/com/bah/lucene/blockcache_v2/cachevalue/UnsafeCacheValueTest.java | // Path: src/main/java/com/bah/lucene/blockcache_v2/cachevalue/UnsafeCacheValue.java
// @SuppressWarnings("serial")
// public class UnsafeCacheValue extends BaseCacheValue {
//
// private static final String JAVA_NIO_BITS = "java.nio.Bits";
// private static final Unsafe _unsafe;
// private static final AtomicLo... | import static org.junit.Assert.*;
import org.junit.Test;
import com.bah.lucene.blockcache_v2.cachevalue.UnsafeCacheValue; | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | // Path: src/main/java/com/bah/lucene/blockcache_v2/cachevalue/UnsafeCacheValue.java
// @SuppressWarnings("serial")
// public class UnsafeCacheValue extends BaseCacheValue {
//
// private static final String JAVA_NIO_BITS = "java.nio.Bits";
// private static final Unsafe _unsafe;
// private static final AtomicLo... | UnsafeCacheValue value = new UnsafeCacheValue(10); |
booz-allen-hamilton/lucene-hdfs-directory | src/test/java/com/bah/lucene/CacheDirectoryTestSuiteOnHeap.java | // Path: src/main/java/com/bah/lucene/blockcache_v2/BaseCache.java
// public enum STORE {
// ON_HEAP, OFF_HEAP
// }
| import org.junit.Test;
import com.bah.lucene.blockcache_v2.BaseCache.STORE; | package com.bah.lucene;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
*... | // Path: src/main/java/com/bah/lucene/blockcache_v2/BaseCache.java
// public enum STORE {
// ON_HEAP, OFF_HEAP
// }
// Path: src/test/java/com/bah/lucene/CacheDirectoryTestSuiteOnHeap.java
import org.junit.Test;
import com.bah.lucene.blockcache_v2.BaseCache.STORE;
package com.bah.lucene;
/**
* Licensed to the Ap... | protected STORE getStore() { |
booz-allen-hamilton/lucene-hdfs-directory | src/main/java/com/bah/lucene/blockcache_v2/CacheIndexOutput.java | // Path: src/main/java/com/bah/lucene/buffer/BufferStore.java
// public class BufferStore {
//
// public static final int _1024_DEFAULT_SIZE = 8192;
// public static final int _8192_DEFAULT_SIZE = 8192;
//
// private static final Log LOG = LogFactory.getLog(BufferStore.class);
//
// private static Blocking... | import java.io.IOException;
import org.apache.lucene.store.IndexOutput;
import com.bah.lucene.buffer.BufferStore; | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | // Path: src/main/java/com/bah/lucene/buffer/BufferStore.java
// public class BufferStore {
//
// public static final int _1024_DEFAULT_SIZE = 8192;
// public static final int _8192_DEFAULT_SIZE = 8192;
//
// private static final Log LOG = LogFactory.getLog(BufferStore.class);
//
// private static Blocking... | _buffer = BufferStore.takeBuffer(_cacheBlockSize); |
orangesignal/orangesignal-csv | src/test/java/com/orangesignal/csv/io/CsvBeanWriterTest.java | // Path: src/test/java/com/orangesignal/csv/Constants.java
// public abstract class Constants {
//
// public static final String CR = "\r";
//
// public static final String LF = "\n";
//
// public static final String CRLF = CR + LF;
//
// }
| import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import java.io.IOException;
import java.io.StringWriter;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import org.junit.BeforeCl... | /*
* Copyright 2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | // Path: src/test/java/com/orangesignal/csv/Constants.java
// public abstract class Constants {
//
// public static final String CR = "\r";
//
// public static final String LF = "\n";
//
// public static final String CRLF = CR + LF;
//
// }
// Path: src/test/java/com/orangesignal/csv/io/CsvBeanWriterTe... | cfg.setLineSeparator(Constants.CRLF);
|
iloveeclipse/datahierarchy | DataHierarchy/src/de/loskutov/dh/actions/CancelSearchAction.java | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.u... | /*******************************************************************************
* Copyright (c) 2009 - 2015 Andrey Loskutov.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is a... | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | action.setEnabled(event.getJob().belongsTo(DataHierarchyPlugin.JOB_FAMILY));
|
iloveeclipse/datahierarchy | DataHierarchy/src/de/loskutov/dh/preferences/DataHierarchyPreferencePage.java | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | import java.util.List;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.sw... | TabFolder tabFolder = new TabFolder(parent, SWT.TOP);
tabFolder.setLayout(new GridLayout(1, true));
tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
TabItem tabFilter = new TabItem(tabFolder, SWT.NONE);
tabFilter.setText("Filters");
Group defPanel = new... | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | return DataHierarchyPlugin.getDefault().getPreferenceStore();
|
iloveeclipse/datahierarchy | DataHierarchy/src/de/loskutov/dh/search/AbstractReferencesRequestor.java | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.search.SearchMatch;
import org.eclipse.jdt.core.search.SearchRequestor;
import de.loskutov.dh.DataHierarchyPlugin;
| /*******************************************************************************
* Copyright (c) 2009 - 2015 Andrey Loskutov.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is a... | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | DataHierarchyPlugin.logError("getResults() interrupted...", e);
|
iloveeclipse/datahierarchy | DataHierarchy/src/de/loskutov/dh/preferences/SupportPanel.java | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.s... | public void handleEvent(Event event) {
handleUrlClick("http://marketplace.eclipse.org/content/data-hierarchy");
}
});
link = new Link(commonPanel, SWT.NONE);
link.setFont(font);
link.setText(" - <a>make a donation to support plugin development</a>... | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | DataHierarchyPlugin.logError("Failed to open url " + urlStr, e); |
iloveeclipse/datahierarchy | DataHierarchy/src/de/loskutov/dh/views/DefaultToggleAction.java | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | import org.eclipse.jface.action.Action;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import de.loskutov.dh.DataHierarchyPlugin;
import de.loskutov.dh.Messages; | /*******************************************************************************
* Copyright (c) 2009 - 2015 Andrey Loskutov.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is avail... | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | IPreferenceStore store = DataHierarchyPlugin.getDefault().getPreferenceStore(); |
iloveeclipse/datahierarchy | DataHierarchy/src/de/loskutov/dh/views/DefaultToggleAction.java | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | import org.eclipse.jface.action.Action;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import de.loskutov.dh.DataHierarchyPlugin;
import de.loskutov.dh.Messages; | /*******************************************************************************
* Copyright (c) 2009 - 2015 Andrey Loskutov.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is avail... | // Path: DataHierarchy/src/de/loskutov/dh/DataHierarchyPlugin.java
// public class DataHierarchyPlugin extends AbstractUIPlugin {
//
// private static DataHierarchyPlugin plugin;
//
// private int viewCount;
//
// public static final Object JOB_FAMILY = DataHierarchyPlugin.class;
//
// publi... | String imageFilePath = Messages.get(ACTION + "_" + myId + "_" + IMAGE); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/data/api/service/FollowersService.java | // Path: app/src/main/java/com/ge/protein/data/model/Shot.java
// @AutoValue
// public abstract class Shot implements Parcelable {
//
// public abstract long id();
//
// public abstract String title();
//
// @Nullable
// public abstract String description();
//
// public abstract int width();
//... | import com.ge.protein.data.model.Shot;
import java.util.List;
import io.reactivex.Observable;
import retrofit2.Response;
import retrofit2.http.GET;
import retrofit2.http.Query; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/Shot.java
// @AutoValue
// public abstract class Shot implements Parcelable {
//
// public abstract long id();
//
// public abstract String title();
//
// @Nullable
// public abstract String description();
//
// public abstract int width();
//... | Observable<Response<List<Shot>>> listFollowingShots(@Query("per_page") int perPage); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/data/api/service/AccessTokenService.java | // Path: app/src/main/java/com/ge/protein/data/model/AccessToken.java
// @AutoValue
// public abstract class AccessToken {
//
// public abstract String access_token();
//
// public abstract String token_type();
//
// public abstract String scope();
//
// public static TypeAdapter<AccessToken> typeAd... | import com.ge.protein.data.model.AccessToken;
import io.reactivex.Observable;
import retrofit2.Response;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import retrofit2.http.Url; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/AccessToken.java
// @AutoValue
// public abstract class AccessToken {
//
// public abstract String access_token();
//
// public abstract String token_type();
//
// public abstract String scope();
//
// public static TypeAdapter<AccessToken> typeAd... | Observable<Response<AccessToken>> getAccessToken(@Url String url, |
gejiaheng/Protein | app/src/main/java/com/ge/protein/auth/AuthRepository.java | // Path: app/src/main/java/com/ge/protein/data/api/ApiConstants.java
// public final class ApiConstants {
//
// private ApiConstants() {
// throw new AssertionError("No construction for constant class");
// }
//
// // general constants of Dribbble API
// public static final String DRIBBBLE_V1_... | import com.ge.protein.BuildConfig;
import com.ge.protein.data.api.ApiConstants;
import com.ge.protein.data.api.ServiceGenerator;
import com.ge.protein.data.api.service.AccessTokenService;
import com.ge.protein.data.model.AccessToken;
import com.ge.protein.util.AccountManager;
import io.reactivex.Observable;
import retr... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/api/ApiConstants.java
// public final class ApiConstants {
//
// private ApiConstants() {
// throw new AssertionError("No construction for constant class");
// }
//
// // general constants of Dribbble API
// public static final String DRIBBBLE_V1_... | accessTokenService = ServiceGenerator.createService(AccessTokenService.class, |
gejiaheng/Protein | app/src/main/java/com/ge/protein/data/api/service/ShotsService.java | // Path: app/src/main/java/com/ge/protein/data/model/Comment.java
// @AutoValue
// public abstract class Comment implements Parcelable {
//
// public abstract long id();
//
// public abstract String body();
//
// public abstract long likes_count();
//
// public abstract String likes_url();
//
// ... | import com.ge.protein.data.model.Comment;
import com.ge.protein.data.model.Shot;
import com.ge.protein.data.model.ShotLike;
import java.util.List;
import io.reactivex.Observable;
import retrofit2.Response;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
i... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/Comment.java
// @AutoValue
// public abstract class Comment implements Parcelable {
//
// public abstract long id();
//
// public abstract String body();
//
// public abstract long likes_count();
//
// public abstract String likes_url();
//
// ... | Observable<Response<Shot>> getShot(@Path("shot_id") long shotId); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/data/api/service/ShotsService.java | // Path: app/src/main/java/com/ge/protein/data/model/Comment.java
// @AutoValue
// public abstract class Comment implements Parcelable {
//
// public abstract long id();
//
// public abstract String body();
//
// public abstract long likes_count();
//
// public abstract String likes_url();
//
// ... | import com.ge.protein.data.model.Comment;
import com.ge.protein.data.model.Shot;
import com.ge.protein.data.model.ShotLike;
import java.util.List;
import io.reactivex.Observable;
import retrofit2.Response;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
i... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/Comment.java
// @AutoValue
// public abstract class Comment implements Parcelable {
//
// public abstract long id();
//
// public abstract String body();
//
// public abstract long likes_count();
//
// public abstract String likes_url();
//
// ... | Observable<Response<List<Comment>>> listCommentsForShot(@Path("shot_id") long shotId, |
gejiaheng/Protein | app/src/main/java/com/ge/protein/data/api/service/ShotsService.java | // Path: app/src/main/java/com/ge/protein/data/model/Comment.java
// @AutoValue
// public abstract class Comment implements Parcelable {
//
// public abstract long id();
//
// public abstract String body();
//
// public abstract long likes_count();
//
// public abstract String likes_url();
//
// ... | import com.ge.protein.data.model.Comment;
import com.ge.protein.data.model.Shot;
import com.ge.protein.data.model.ShotLike;
import java.util.List;
import io.reactivex.Observable;
import retrofit2.Response;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
i... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/Comment.java
// @AutoValue
// public abstract class Comment implements Parcelable {
//
// public abstract long id();
//
// public abstract String body();
//
// public abstract long likes_count();
//
// public abstract String likes_url();
//
// ... | Observable<Response<ShotLike>> checkLike(@Path("shot_id") long shotId); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/about/AboutContract.java | // Path: app/src/main/java/com/ge/protein/mvp/BasePresenter.java
// public interface BasePresenter {
//
// void start();
// }
//
// Path: app/src/main/java/com/ge/protein/mvp/BaseView.java
// public interface BaseView<T> {
//
// void setPresenter(T presenter);
//
// Context getContext();
// }
| import com.ge.protein.mvp.BasePresenter;
import com.ge.protein.mvp.BaseView; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/mvp/BasePresenter.java
// public interface BasePresenter {
//
// void start();
// }
//
// Path: app/src/main/java/com/ge/protein/mvp/BaseView.java
// public interface BaseView<T> {
//
// void setPresenter(T presenter);
//
// Context getContext();
// }
// Path:... | interface Presenter extends BasePresenter { |
gejiaheng/Protein | app/src/main/java/com/ge/protein/auth/AuthPresenter.java | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | import com.trello.rxlifecycle2.android.FragmentEvent;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import static com.ge.protein.util.Preconditions.checkNotNull;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | this.view = checkNotNull(view, "view cannot be null"); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/auth/AuthPresenter.java | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | import com.trello.rxlifecycle2.android.FragmentEvent;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import static com.ge.protein.util.Preconditions.checkNotNull;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | AccessToken accessToken = accessTokenResponse.body(); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/auth/AuthPresenter.java | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | import com.trello.rxlifecycle2.android.FragmentEvent;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import static com.ge.protein.util.Preconditions.checkNotNull;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | AccountManager.getInstance().setAccessToken(accessToken); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/auth/AuthPresenter.java | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | import com.trello.rxlifecycle2.android.FragmentEvent;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import static com.ge.protein.util.Preconditions.checkNotNull;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | Constants.DEFAULT_SHARED_PREFERENCES, Context.MODE_PRIVATE); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/auth/AuthPresenter.java | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | import com.trello.rxlifecycle2.android.FragmentEvent;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import static com.ge.protein.util.Preconditions.checkNotNull;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences... |
@Override
public void start() {
}
@Override
public void getAccessToken(String code) {
view.setProgressDialogVisibility(true);
repository.getAccessToken(code)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.c... | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | Intent intent = new Intent(view.getContext(), MainActivity.class); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/auth/AuthPresenter.java | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | import com.trello.rxlifecycle2.android.FragmentEvent;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import static com.ge.protein.util.Preconditions.checkNotNull;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences... |
@Override
public void getAccessToken(String code) {
view.setProgressDialogVisibility(true);
repository.getAccessToken(code)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.compose(((LifecycleProvider<FragmentEvent>) view)... | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | view.showSnackbar(ErrorUtils.parseError(accessTokenResponse).error()); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ui/activity/BaseProteinActivity.java | // Path: app/src/main/java/com/ge/protein/util/AccountManager.java
// public class AccountManager {
//
// private static AccountManager accountManager = new AccountManager();
// private AccessToken accessToken;
// private User me;
//
// private AccountManager() {
// }
//
// public static Acco... | import android.os.Bundle;
import android.support.annotation.Nullable;
import com.ge.protein.util.AccountManager;
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/util/AccountManager.java
// public class AccountManager {
//
// private static AccountManager accountManager = new AccountManager();
// private AccessToken accessToken;
// private User me;
//
// private AccountManager() {
// }
//
// public static Acco... | login = AccountManager.getInstance().isLogin(); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ui/widget/CircularImageView.java | // Path: app/src/main/java/com/ge/protein/util/ViewUtils.java
// public class ViewUtils {
//
// public static final ViewOutlineProvider CIRCULAR_OUTLINE = new ViewOutlineProvider() {
// @Override
// public void getOutline(View view, Outline outline) {
// outline.setOval(view.getPaddingL... | import android.content.Context;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;
import com.ge.protein.util.ViewUtils; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/util/ViewUtils.java
// public class ViewUtils {
//
// public static final ViewOutlineProvider CIRCULAR_OUTLINE = new ViewOutlineProvider() {
// @Override
// public void getOutline(View view, Outline outline) {
// outline.setOval(view.getPaddingL... | setOutlineProvider(ViewUtils.CIRCULAR_OUTLINE); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/main/MainActivity.java | // Path: app/src/open/java/com/ge/protein/firebase/FirebaseCrashUtils.java
// public class FirebaseCrashUtils {
//
// public static void log(String message) {
// // no-op for product flavor open
// }
// }
//
// Path: app/src/main/java/com/ge/protein/ui/activity/BaseProteinActivity.java
// public abstr... | import android.os.Bundle;
import com.ge.protein.R;
import com.ge.protein.firebase.FirebaseCrashUtils;
import com.ge.protein.ui.activity.BaseProteinActivity;
import hugo.weaving.DebugLog; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/open/java/com/ge/protein/firebase/FirebaseCrashUtils.java
// public class FirebaseCrashUtils {
//
// public static void log(String message) {
// // no-op for product flavor open
// }
// }
//
// Path: app/src/main/java/com/ge/protein/ui/activity/BaseProteinActivity.java
// public abstr... | FirebaseCrashUtils.log("MainActivity created"); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ui/epoxy/models/LoadMoreModel.java | // Path: app/src/main/java/com/ge/protein/ui/epoxy/BaseEpoxyHolder.java
// public abstract class BaseEpoxyHolder extends EpoxyHolder {
// @CallSuper
// @Override
// protected void bindView(View itemView) {
// ButterKnife.bind(this, itemView);
// }
// }
| import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import com.airbnb.epoxy.EpoxyModelClass;
import com.airbnb.epoxy.EpoxyModelWithHolder;
import com.ge.protein.R;... | ObjectAnimator innerXAnimator = ObjectAnimator.ofFloat(holder.inner, "scaleX", 1.33f);
innerXAnimator.setRepeatCount(ValueAnimator.INFINITE);
innerXAnimator.setRepeatMode(ValueAnimator.REVERSE);
ObjectAnimator innerYAnimator = ObjectAnimator.ofFloat(holder.inner, "scaleY... | // Path: app/src/main/java/com/ge/protein/ui/epoxy/BaseEpoxyHolder.java
// public abstract class BaseEpoxyHolder extends EpoxyHolder {
// @CallSuper
// @Override
// protected void bindView(View itemView) {
// ButterKnife.bind(this, itemView);
// }
// }
// Path: app/src/main/java/com/ge/protein... | static class LoadMoreHolder extends BaseEpoxyHolder { |
gejiaheng/Protein | app/src/main/java/com/ge/protein/comment/post/CommentPostPresenter.java | // Path: app/src/main/java/com/ge/protein/data/model/Shot.java
// @AutoValue
// public abstract class Shot implements Parcelable {
//
// public abstract long id();
//
// public abstract String title();
//
// @Nullable
// public abstract String description();
//
// public abstract int width();
//... | import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.ge.protein.R;
import com.ge.protein.data.model.Shot;
import com.ge.protein.util.RxBus;
import com.trello.rxlifecycle2.LifecycleProvider;
import com.trello.rxlifecycle2.android.FragmentEvent;
import io.reactivex.android.sch... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/Shot.java
// @AutoValue
// public abstract class Shot implements Parcelable {
//
// public abstract long id();
//
// public abstract String title();
//
// @Nullable
// public abstract String description();
//
// public abstract int width();
//... | private Shot shot; |
gejiaheng/Protein | app/src/main/java/com/ge/protein/comment/post/CommentPostPresenter.java | // Path: app/src/main/java/com/ge/protein/data/model/Shot.java
// @AutoValue
// public abstract class Shot implements Parcelable {
//
// public abstract long id();
//
// public abstract String title();
//
// @Nullable
// public abstract String description();
//
// public abstract int width();
//... | import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.ge.protein.R;
import com.ge.protein.data.model.Shot;
import com.ge.protein.util.RxBus;
import com.trello.rxlifecycle2.LifecycleProvider;
import com.trello.rxlifecycle2.android.FragmentEvent;
import io.reactivex.android.sch... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/Shot.java
// @AutoValue
// public abstract class Shot implements Parcelable {
//
// public abstract long id();
//
// public abstract String title();
//
// @Nullable
// public abstract String description();
//
// public abstract int width();
//... | this.shot = checkNotNull(shot, "shot cannot be null"); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/comment/post/CommentPostPresenter.java | // Path: app/src/main/java/com/ge/protein/data/model/Shot.java
// @AutoValue
// public abstract class Shot implements Parcelable {
//
// public abstract long id();
//
// public abstract String title();
//
// @Nullable
// public abstract String description();
//
// public abstract int width();
//... | import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.ge.protein.R;
import com.ge.protein.data.model.Shot;
import com.ge.protein.util.RxBus;
import com.trello.rxlifecycle2.LifecycleProvider;
import com.trello.rxlifecycle2.android.FragmentEvent;
import io.reactivex.android.sch... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/Shot.java
// @AutoValue
// public abstract class Shot implements Parcelable {
//
// public abstract long id();
//
// public abstract String title();
//
// @Nullable
// public abstract String description();
//
// public abstract int width();
//... | RxBus.getInstance().post(commentResponse.body()); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/auth/AuthActivity.java | // Path: app/src/open/java/com/ge/protein/firebase/FirebaseCrashUtils.java
// public class FirebaseCrashUtils {
//
// public static void log(String message) {
// // no-op for product flavor open
// }
// }
//
// Path: app/src/main/java/com/ge/protein/ui/activity/BaseProteinActivity.java
// public abstr... | import android.os.Bundle;
import android.support.annotation.Nullable;
import com.ge.protein.R;
import com.ge.protein.firebase.FirebaseCrashUtils;
import com.ge.protein.ui.activity.BaseProteinActivity; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/open/java/com/ge/protein/firebase/FirebaseCrashUtils.java
// public class FirebaseCrashUtils {
//
// public static void log(String message) {
// // no-op for product flavor open
// }
// }
//
// Path: app/src/main/java/com/ge/protein/ui/activity/BaseProteinActivity.java
// public abstr... | FirebaseCrashUtils.log("AuthActivity created"); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ui/activity/DeepLinkActivity.java | // Path: app/src/main/java/com/ge/protein/ProteinDeepLinkModule.java
// @DeepLinkModule
// public class ProteinDeepLinkModule {
// }
//
// Path: app/src/open/java/com/ge/protein/firebase/FirebaseCrashUtils.java
// public class FirebaseCrashUtils {
//
// public static void log(String message) {
// // no-op... | import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import com.airbnb.deeplinkdispatch.DeepLinkHandler;
import com.ge.protein.ProteinDeepLinkModule;
import com.ge.protein.ProteinDeepLinkModuleLoader;
import com.ge.protein.firebase.FirebaseCrashUtils; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/ProteinDeepLinkModule.java
// @DeepLinkModule
// public class ProteinDeepLinkModule {
// }
//
// Path: app/src/open/java/com/ge/protein/firebase/FirebaseCrashUtils.java
// public class FirebaseCrashUtils {
//
// public static void log(String message) {
// // no-op... | FirebaseCrashUtils.log("DeepLinkActivity created"); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/user/UserRepository.java | // Path: app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java
// public class ServiceGenerator {
//
// private static String lastToken;
//
// private static Gson gson = new GsonBuilder()
// .registerTypeAdapterFactory(ProteinAdapterFactory.create())
// .create();
//
// ... | import com.ge.protein.data.api.ServiceGenerator;
import com.ge.protein.data.api.service.UserService;
import com.ge.protein.util.AccountManager;
import io.reactivex.Observable;
import retrofit2.Response;
import retrofit2.http.Body; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java
// public class ServiceGenerator {
//
// private static String lastToken;
//
// private static Gson gson = new GsonBuilder()
// .registerTypeAdapterFactory(ProteinAdapterFactory.create())
// .create();
//
// ... | userService = ServiceGenerator.createService(UserService.class, |
gejiaheng/Protein | app/src/main/java/com/ge/protein/user/UserRepository.java | // Path: app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java
// public class ServiceGenerator {
//
// private static String lastToken;
//
// private static Gson gson = new GsonBuilder()
// .registerTypeAdapterFactory(ProteinAdapterFactory.create())
// .create();
//
// ... | import com.ge.protein.data.api.ServiceGenerator;
import com.ge.protein.data.api.service.UserService;
import com.ge.protein.util.AccountManager;
import io.reactivex.Observable;
import retrofit2.Response;
import retrofit2.http.Body; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java
// public class ServiceGenerator {
//
// private static String lastToken;
//
// private static Gson gson = new GsonBuilder()
// .registerTypeAdapterFactory(ProteinAdapterFactory.create())
// .create();
//
// ... | AccountManager.getInstance().getAccessToken()); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/user/UserView.java | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentActiv... | TabLayout tabLayout;
@BindView(R.id.view_pager)
ViewPager viewPager;
public UserView(Context context) {
super(context);
init(context);
}
public UserView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public UserView(Conte... | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | public void setupView(User user) { |
gejiaheng/Protein | app/src/main/java/com/ge/protein/user/UserView.java | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentActiv... | ButterKnife.bind(this);
}
@Override
public void setPresenter(UserContract.Presenter presenter) {
this.presenter = presenter;
}
@Override
public void setupView(User user) {
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
toolbar.getNavigationIcon(... | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | TabCustomView shotsTabCustomView = new TabCustomView(getContext()); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/about/AboutFragment.java | // Path: app/src/main/java/com/ge/protein/mvp/BaseFragment.java
// public class BaseFragment extends RxFragment {
// }
//
// Path: app/src/main/java/com/ge/protein/ui/widget/FourThreeImageView.java
// public class FourThreeImageView extends AppCompatImageView {
//
// public FourThreeImageView(Context context, Att... | import android.graphics.PorterDuff;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.Toolbar;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.Spanned;
import android.t... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/mvp/BaseFragment.java
// public class BaseFragment extends RxFragment {
// }
//
// Path: app/src/main/java/com/ge/protein/ui/widget/FourThreeImageView.java
// public class FourThreeImageView extends AppCompatImageView {
//
// public FourThreeImageView(Context context, Att... | FourThreeImageView bannerImage; |
gejiaheng/Protein | app/src/main/java/com/ge/protein/mvp/ListPresenter.java | // Path: app/src/main/java/com/ge/protein/util/Preconditions.java
// public static <T> T checkNotNull(T reference, @Nullable Object errorMessage) {
// if(reference == null) {
// throw new NullPointerException(String.valueOf(errorMessage));
// } else {
// return reference;
// }
// }
| import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import static com.ge.protein.util.Preconditions.checkNotNull; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/util/Preconditions.java
// public static <T> T checkNotNull(T reference, @Nullable Object errorMessage) {
// if(reference == null) {
// throw new NullPointerException(String.valueOf(errorMessage));
// } else {
// return reference;
// }
// }
// Path... | this.view = checkNotNull(view, "view cannot be null"); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ui/dialog/LogoutDialog.java | // Path: app/src/main/java/com/ge/protein/main/MainActivity.java
// public class MainActivity extends BaseProteinActivity {
//
// private MainPresenter mainPresenter;
//
// @DebugLog
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// ... | import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import com.ge.protein.R;
impor... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/main/MainActivity.java
// public class MainActivity extends BaseProteinActivity {
//
// private MainPresenter mainPresenter;
//
// @DebugLog
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// ... | AccountManager.getInstance().clear(); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ui/dialog/LogoutDialog.java | // Path: app/src/main/java/com/ge/protein/main/MainActivity.java
// public class MainActivity extends BaseProteinActivity {
//
// private MainPresenter mainPresenter;
//
// @DebugLog
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// ... | import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import com.ge.protein.R;
impor... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/main/MainActivity.java
// public class MainActivity extends BaseProteinActivity {
//
// private MainPresenter mainPresenter;
//
// @DebugLog
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// ... | SharedPreferences sp = getActivity().getSharedPreferences(Constants.DEFAULT_SHARED_PREFERENCES, |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ui/dialog/LogoutDialog.java | // Path: app/src/main/java/com/ge/protein/main/MainActivity.java
// public class MainActivity extends BaseProteinActivity {
//
// private MainPresenter mainPresenter;
//
// @DebugLog
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// ... | import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import com.ge.protein.R;
impor... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/main/MainActivity.java
// public class MainActivity extends BaseProteinActivity {
//
// private MainPresenter mainPresenter;
//
// @DebugLog
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// ... | Intent intent = new Intent(getContext(), MainActivity.class); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | import android.content.Context;
import com.facebook.stetho.okhttp3.StethoInterceptor;
import com.ge.protein.BuildConfig;
import com.ge.protein.data.ProteinAdapterFactory;
import com.ge.protein.data.model.AccessToken;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import okhttp3.Cache;
import okhttp3.O... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | .registerTypeAdapterFactory(ProteinAdapterFactory.create()) |
gejiaheng/Protein | app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | import android.content.Context;
import com.facebook.stetho.okhttp3.StethoInterceptor;
import com.ge.protein.BuildConfig;
import com.ge.protein.data.ProteinAdapterFactory;
import com.ge.protein.data.model.AccessToken;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import okhttp3.Cache;
import okhttp3.O... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | public static <S> S createService(Class<S> serviceClass, final AccessToken token) { |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ui/dialog/LoginGuideDialog.java | // Path: app/src/main/java/com/ge/protein/auth/AuthActivity.java
// public class AuthActivity extends BaseProteinActivity {
//
// private AuthPresenter authPresenter;
//
// @Override
// protected void onCreate(@Nullable Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// ... | import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
im... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/auth/AuthActivity.java
// public class AuthActivity extends BaseProteinActivity {
//
// private AuthPresenter authPresenter;
//
// @Override
// protected void onCreate(@Nullable Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// ... | .throttleFirst(RxUtils.WINDOW_DURATION, RxUtils.TIME_UNIT) |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ui/dialog/LoginGuideDialog.java | // Path: app/src/main/java/com/ge/protein/auth/AuthActivity.java
// public class AuthActivity extends BaseProteinActivity {
//
// private AuthPresenter authPresenter;
//
// @Override
// protected void onCreate(@Nullable Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// ... | import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
im... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/auth/AuthActivity.java
// public class AuthActivity extends BaseProteinActivity {
//
// private AuthPresenter authPresenter;
//
// @Override
// protected void onCreate(@Nullable Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// ... | startActivity(new Intent(getContext(), AuthActivity.class)); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/user/UserActivity.java | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | import android.os.Bundle;
import android.support.annotation.Nullable;
import com.ge.protein.R;
import com.ge.protein.data.model.User;
import com.ge.protein.firebase.FirebaseCrashUtils;
import com.ge.protein.ui.activity.BaseProteinActivity; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | private User user; |
gejiaheng/Protein | app/src/main/java/com/ge/protein/user/UserActivity.java | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | import android.os.Bundle;
import android.support.annotation.Nullable;
import com.ge.protein.R;
import com.ge.protein.data.model.User;
import com.ge.protein.firebase.FirebaseCrashUtils;
import com.ge.protein.ui.activity.BaseProteinActivity; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | FirebaseCrashUtils.log("UserActivity created"); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ProteinApp.java | // Path: app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java
// public class ServiceGenerator {
//
// private static String lastToken;
//
// private static Gson gson = new GsonBuilder()
// .registerTypeAdapterFactory(ProteinAdapterFactory.create())
// .create();
//
// ... | import android.app.Application;
import android.content.SharedPreferences;
import android.text.TextUtils;
import com.facebook.stetho.Stetho;
import com.ge.protein.data.api.ServiceGenerator;
import com.ge.protein.util.AccountManager;
import com.ge.protein.util.Constants;
import com.squareup.leakcanary.RefWatcher;
import ... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java
// public class ServiceGenerator {
//
// private static String lastToken;
//
// private static Gson gson = new GsonBuilder()
// .registerTypeAdapterFactory(ProteinAdapterFactory.create())
// .create();
//
// ... | ServiceGenerator.init(this); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ProteinApp.java | // Path: app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java
// public class ServiceGenerator {
//
// private static String lastToken;
//
// private static Gson gson = new GsonBuilder()
// .registerTypeAdapterFactory(ProteinAdapterFactory.create())
// .create();
//
// ... | import android.app.Application;
import android.content.SharedPreferences;
import android.text.TextUtils;
import com.facebook.stetho.Stetho;
import com.ge.protein.data.api.ServiceGenerator;
import com.ge.protein.util.AccountManager;
import com.ge.protein.util.Constants;
import com.squareup.leakcanary.RefWatcher;
import ... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java
// public class ServiceGenerator {
//
// private static String lastToken;
//
// private static Gson gson = new GsonBuilder()
// .registerTypeAdapterFactory(ProteinAdapterFactory.create())
// .create();
//
// ... | SharedPreferences sp = getSharedPreferences(Constants.DEFAULT_SHARED_PREFERENCES, MODE_PRIVATE); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/ProteinApp.java | // Path: app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java
// public class ServiceGenerator {
//
// private static String lastToken;
//
// private static Gson gson = new GsonBuilder()
// .registerTypeAdapterFactory(ProteinAdapterFactory.create())
// .create();
//
// ... | import android.app.Application;
import android.content.SharedPreferences;
import android.text.TextUtils;
import com.facebook.stetho.Stetho;
import com.ge.protein.data.api.ServiceGenerator;
import com.ge.protein.util.AccountManager;
import com.ge.protein.util.Constants;
import com.squareup.leakcanary.RefWatcher;
import ... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/api/ServiceGenerator.java
// public class ServiceGenerator {
//
// private static String lastToken;
//
// private static Gson gson = new GsonBuilder()
// .registerTypeAdapterFactory(ProteinAdapterFactory.create())
// .create();
//
// ... | AccountManager.getInstance().setAccessToken(accessToken); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/util/AccountManager.java | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | import com.ge.protein.data.ProteinAdapterFactory;
import com.ge.protein.data.model.AccessToken;
import com.ge.protein.data.model.User;
import com.google.gson.GsonBuilder; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | private AccessToken accessToken; |
gejiaheng/Protein | app/src/main/java/com/ge/protein/util/AccountManager.java | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | import com.ge.protein.data.ProteinAdapterFactory;
import com.ge.protein.data.model.AccessToken;
import com.ge.protein.data.model.User;
import com.google.gson.GsonBuilder; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | private User me; |
gejiaheng/Protein | app/src/main/java/com/ge/protein/util/AccountManager.java | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | import com.ge.protein.data.ProteinAdapterFactory;
import com.ge.protein.data.model.AccessToken;
import com.ge.protein.data.model.User;
import com.google.gson.GsonBuilder; | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/ProteinAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class ProteinAdapterFactory implements TypeAdapterFactory {
//
// public static TypeAdapterFactory create() {
// return new AutoValueGson_ProteinAdapterFactory();
// }
// }
//
// Pat... | .registerTypeAdapterFactory(ProteinAdapterFactory.create()) |
gejiaheng/Protein | app/src/main/java/com/ge/protein/user/UserPresenter.java | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | import io.reactivex.schedulers.Schedulers;
import static com.ge.protein.util.Preconditions.checkNotNull;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import andro... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | private User user; |
gejiaheng/Protein | app/src/main/java/com/ge/protein/user/UserPresenter.java | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | import io.reactivex.schedulers.Schedulers;
import static com.ge.protein.util.Preconditions.checkNotNull;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import andro... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | this.view = checkNotNull(view, "view cannot be null"); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/user/UserPresenter.java | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | import io.reactivex.schedulers.Schedulers;
import static com.ge.protein.util.Preconditions.checkNotNull;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import andro... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | if (AccountManager.getInstance().getMe() == null || AccountManager.getInstance().getMe().equals(user)) { |
gejiaheng/Protein | app/src/main/java/com/ge/protein/mvp/ListFragment.java | // Path: app/src/main/java/com/ge/protein/ui/epoxy/ProteinAdapter.java
// public class ProteinAdapter extends EpoxyAdapter {
//
// private final LoadMoreModel loadMoreModel;
//
// public ProteinAdapter() {
// loadMoreModel = new LoadMoreModel_();
// }
//
// public void swap(Collection<? exten... | import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.desig... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/ui/epoxy/ProteinAdapter.java
// public class ProteinAdapter extends EpoxyAdapter {
//
// private final LoadMoreModel loadMoreModel;
//
// public ProteinAdapter() {
// loadMoreModel = new LoadMoreModel_();
// }
//
// public void swap(Collection<? exten... | protected ProteinAdapter proteinAdapter; |
gejiaheng/Protein | app/src/main/java/com/ge/protein/mvp/ListFragment.java | // Path: app/src/main/java/com/ge/protein/ui/epoxy/ProteinAdapter.java
// public class ProteinAdapter extends EpoxyAdapter {
//
// private final LoadMoreModel loadMoreModel;
//
// public ProteinAdapter() {
// loadMoreModel = new LoadMoreModel_();
// }
//
// public void swap(Collection<? exten... | import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.desig... | /*
* Copyright 2017 Jiaheng Ge
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | // Path: app/src/main/java/com/ge/protein/ui/epoxy/ProteinAdapter.java
// public class ProteinAdapter extends EpoxyAdapter {
//
// private final LoadMoreModel loadMoreModel;
//
// public ProteinAdapter() {
// loadMoreModel = new LoadMoreModel_();
// }
//
// public void swap(Collection<? exten... | protected RecyclerViewObserver recyclerViewObserver; |
gejiaheng/Protein | app/src/main/java/com/ge/protein/main/MainView.java | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import an... | ViewPager viewPager;
public MainView(Context context) {
super(context);
init(context);
}
public MainView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public MainView(Context context, AttributeSet attrs, int defStyleAttr) {
... | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | .throttleFirst(RxUtils.WINDOW_DURATION, RxUtils.TIME_UNIT) |
gejiaheng/Protein | app/src/main/java/com/ge/protein/main/MainView.java | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import an... | init(context);
}
public MainView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public MainView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
private void i... | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | toolbar.getMenu().findItem(R.id.action_logout).setEnabled(AccountManager.getInstance().isLogin()); |
gejiaheng/Protein | app/src/main/java/com/ge/protein/main/MainView.java | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import an... | }
return false;
});
viewPager.setAdapter(new MainPagerAdapter(((FragmentActivity) getContext()).getSupportFragmentManager()));
// Add 4 tabs for TabLayout
tabLayout.addTab(tabLayout.newTab().setText(R.string.home_tab_popular)); // Popular
if (AccountMana... | // Path: app/src/main/java/com/ge/protein/data/model/User.java
// @AutoValue
// public abstract class User implements Parcelable {
//
// public abstract long id();
//
// public abstract String name();
//
// public abstract String username();
//
// public abstract String html_url();
//
// public... | public void setUserInfo(User user) { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.